/*
 Navicat Premium Data Transfer

 Source Server         : newPay
 Source Server Type    : MySQL
 Source Server Version : 50736
 Source Host           : 47.99.193.46:30006
 Source Schema         : xpay_common_dev

 Target Server Type    : MySQL
 Target Server Version : 50736
 File Encoding         : 65001

 Date: 21/07/2024 11:24:55
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for admin_user
-- ----------------------------
DROP TABLE IF EXISTS `admin_user`;
CREATE TABLE `admin_user` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `username` varchar(128) NOT NULL COMMENT '用户名',
  `avatar` varchar(255) NOT NULL COMMENT '头像',
  `email` varchar(128) NOT NULL COMMENT '邮箱',
  `mobile` varchar(128) NOT NULL COMMENT '手机号',
  `enabled` int(20) NOT NULL COMMENT '是否激活',
  `password` varchar(128) NOT NULL COMMENT '密码',
  `error_login_count` bigint(20) NOT NULL COMMENT '错误登录次数',
  `last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
  `last_login_ip` varchar(128) DEFAULT NULL COMMENT '最后登录ip',
  `last_password_reset_time` datetime NOT NULL COMMENT '最后一次重置密码时间',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `mobile` (`mobile`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of admin_user
-- ----------------------------
BEGIN;
INSERT INTO `admin_user` VALUES (1, '超管', 'https://img.zcool.cn/community/01b4aa5bc1e527a8012099c85263eb.png@1280w_1l_2o_100sh.png', '', '18888888888', 1, '$2a$10$cV0scQvNsnfVX1T877ithOm7XcXUUwkjdJjZU1aCl41B1rewNkYqC', 0, NULL, NULL, '2024-02-18 11:20:18', '2024-02-18 11:20:18', '2024-02-18 11:20:18');
COMMIT;

-- ----------------------------
-- Table structure for admin_user_role
-- ----------------------------
DROP TABLE IF EXISTS `admin_user_role`;
CREATE TABLE `admin_user_role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `admin_user_id` bigint(20) NOT NULL COMMENT '管理员id',
  `role_id` bigint(20) NOT NULL COMMENT '角色id',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `admin_user_id_2` (`admin_user_id`,`role_id`),
  KEY `admin_user_id` (`admin_user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of admin_user_role
-- ----------------------------
BEGIN;
INSERT INTO `admin_user_role` VALUES (1, 1, 1, '2024-02-18 10:38:32', '2024-02-18 10:38:32');
COMMIT;

-- ----------------------------
-- Table structure for alipay_user_sign_auth_record
-- ----------------------------
DROP TABLE IF EXISTS `alipay_user_sign_auth_record`;
CREATE TABLE `alipay_user_sign_auth_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `biz_no` varchar(128) DEFAULT NULL COMMENT '签约授权一体化事务号orderId',
  `isv_biz_id` varchar(128) DEFAULT NULL COMMENT '内部事务号和alipayUser内的一致',
  `batch_no` varchar(128) DEFAULT NULL COMMENT '签约单事务号',
  `alipay_nick_name` varchar(32) DEFAULT NULL COMMENT '支付宝账号',
  `contact_mobile` varchar(11) DEFAULT NULL COMMENT '联系人手机号码',
  `contact_name` varchar(64) DEFAULT NULL COMMENT '联系人姓名',
  `contact_email` varchar(64) DEFAULT NULL COMMENT '联系人邮箱',
  `status` varchar(16) DEFAULT NULL COMMENT '签约授权状态',
  `sign_failure_reason` varchar(2048) DEFAULT NULL COMMENT '签约失败原因',
  `auth_submit_time` datetime DEFAULT NULL COMMENT '授权提交时间',
  `auth_end_time` datetime DEFAULT NULL COMMENT '授权结束时间',
  `sign_submit_time` datetime DEFAULT NULL COMMENT '签约提交时间',
  `sign_end_time` datetime DEFAULT NULL COMMENT '签约结束时间',
  `auth_status` int(20) DEFAULT NULL COMMENT '授权状态',
  `auth_token` varchar(128) DEFAULT NULL COMMENT 'auth_token',
  `refresh_token` varchar(128) DEFAULT NULL COMMENT 'refresh_token',
  `expires_in` datetime DEFAULT NULL COMMENT 'auth_token过期时间',
  `re_expires_in` datetime DEFAULT NULL COMMENT 'refresh_token过期时间',
  `alipay_user_id` varchar(128) DEFAULT NULL COMMENT '支付宝id',
  `is_audit_timeout` int(20) DEFAULT NULL COMMENT '签约是否审核超时',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `alipay_nick_name_user_id_idx` (`alipay_nick_name`,`user_id`),
  UNIQUE KEY `biz_no_idx` (`biz_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='签约授权一体化记录表';

-- ----------------------------
-- Records of alipay_user_sign_auth_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for api_monitor
-- ----------------------------
DROP TABLE IF EXISTS `api_monitor`;
CREATE TABLE `api_monitor` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `api_name` varchar(128) NOT NULL COMMENT '接口名称',
  `api` varchar(255) NOT NULL COMMENT '接口路径',
  `ip` varchar(255) NOT NULL COMMENT '服务器ip',
  `day` date NOT NULL COMMENT '日期',
  `hour` int(20) NOT NULL COMMENT '小时',
  `req_count` bigint(20) NOT NULL COMMENT '请求总数',
  `err_req_count` bigint(20) NOT NULL COMMENT '异常数',
  `total_req_cost_time` bigint(20) NOT NULL COMMENT '总耗时（毫秒）',
  `max_req_cost_time` bigint(20) NOT NULL COMMENT '最大耗时（毫秒）',
  `min_req_cost_time` bigint(20) NOT NULL COMMENT '最小耗时（毫秒）',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='接口监控表';

-- ----------------------------
-- Records of api_monitor
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for book_account_large_deposit_charge_order
-- ----------------------------
DROP TABLE IF EXISTS `book_account_large_deposit_charge_order`;
CREATE TABLE `book_account_large_deposit_charge_order` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户编号',
  `alipay_nick_name` varchar(128) DEFAULT NULL COMMENT '支付宝账号',
  `alipay_name` varchar(128) DEFAULT NULL COMMENT '支付宝主体名称',
  `alipay_uid` varchar(128) DEFAULT NULL COMMENT '支付宝官方账号id',
  `trans_amount` decimal(19,2) DEFAULT NULL COMMENT '转账金额 单位元 2位小数 2.00',
  `safe_pay_book_account_id` varchar(128) DEFAULT NULL COMMENT 'safePayBookAccountId',
  `book_id` varchar(128) DEFAULT NULL COMMENT '资金记账本id',
  `agreement_no` varchar(128) DEFAULT NULL COMMENT '支付宝签约协议号',
  `end_time` datetime DEFAULT NULL COMMENT '订单完成时间',
  `order_no` varchar(128) DEFAULT NULL COMMENT '支付宝转账单据号',
  `payer_identity_type` varchar(64) DEFAULT NULL COMMENT '付款账号类型',
  `payer_identity` varchar(128) DEFAULT NULL COMMENT '付款账号',
  `source` varchar(32) DEFAULT NULL COMMENT '充值来源',
  `payer_name` varchar(128) DEFAULT NULL COMMENT '付款人姓名',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `order_no_idx` (`order_no`),
  KEY `user_id_idx` (`user_id`),
  KEY `end_time_idx` (`end_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='记账本汇款充值记录';

-- ----------------------------
-- Records of book_account_large_deposit_charge_order
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for book_account_transfer_order
-- ----------------------------
DROP TABLE IF EXISTS `book_account_transfer_order`;
CREATE TABLE `book_account_transfer_order` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户编号',
  `out_biz_no` varchar(64) DEFAULT NULL COMMENT '明细外部订单号',
  `import_biz_no` varchar(64) NOT NULL COMMENT '导入的明细外部订单号',
  `payer_safe_pay_book_account_id` bigint(20) NOT NULL COMMENT '付款方账号id',
  `payer_alipay_account` varchar(128) NOT NULL COMMENT '付款方支付宝账号',
  `payer_agreement_no` varchar(128) NOT NULL COMMENT '签约协议号',
  `payer_book_id` varchar(128) NOT NULL COMMENT '付款方资金记账本id',
  `payee_safe_pay_book_account_id` bigint(20) NOT NULL COMMENT '收款方账号id',
  `payee_alipay_account` varchar(128) NOT NULL COMMENT '收款方支付宝账号',
  `payee_agreement_no` varchar(128) NOT NULL COMMENT '收款方支付宝签约协议号',
  `payee_book_id` varchar(128) NOT NULL COMMENT '收款方资金记账本id',
  `order_title` varchar(32) DEFAULT NULL COMMENT '转账业务的标题，用于在支付宝用户的账单里显示',
  `remark` varchar(32) DEFAULT NULL COMMENT '在单笔金额超过 50000 的时候必传。',
  `trans_amount` decimal(19,2) NOT NULL COMMENT '明细金额 单位为元（最小1元），精确到小数点后两位 必选',
  `pay_fund_order_id` varchar(128) DEFAULT NULL COMMENT '支付宝支付资金流水号，仅当转账成功才会返回该参数',
  `order_id` varchar(128) DEFAULT NULL COMMENT '支付宝转账单据号',
  `status` varchar(32) NOT NULL COMMENT '状态',
  `start_time` datetime DEFAULT NULL COMMENT '开始触发打款时间',
  `trans_date` datetime DEFAULT NULL COMMENT '转账日期',
  `end_time` datetime DEFAULT NULL COMMENT '转账完成时间',
  `error_code` varchar(255) DEFAULT NULL COMMENT '错误码',
  `error_msg` varchar(255) DEFAULT NULL COMMENT '错误原因',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_idx` (`user_id`,`import_biz_no`),
  UNIQUE KEY `out_biz_no_idx` (`out_biz_no`),
  KEY `import_biz_no_idx` (`import_biz_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='记账本资金调拨记录';

-- ----------------------------
-- Records of book_account_transfer_order
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for charge_notify_record
-- ----------------------------
DROP TABLE IF EXISTS `charge_notify_record`;
CREATE TABLE `charge_notify_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `app_id` bigint(20) DEFAULT NULL COMMENT '应用id',
  `import_batch_no` varchar(64) DEFAULT NULL COMMENT '外部批次号',
  `pay_trans_batch_id` bigint(20) NOT NULL COMMENT '批次号',
  `status` int(20) NOT NULL COMMENT '状态',
  `end_time` datetime DEFAULT NULL COMMENT '处理结束时间',
  `notify_count` int(20) NOT NULL COMMENT '通知次数',
  `next_notify_time` datetime NOT NULL COMMENT '下次通知时间',
  `notify_content` longtext COMMENT '通知内容',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `status_idx` (`status`),
  KEY `pay_trans_batch_id_idx` (`pay_trans_batch_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='充值通知回调表';

-- ----------------------------
-- Records of charge_notify_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for charge_record_notify_record
-- ----------------------------
DROP TABLE IF EXISTS `charge_record_notify_record`;
CREATE TABLE `charge_record_notify_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `app_id` bigint(20) NOT NULL COMMENT '应用id',
  `import_biz_no` varchar(64) DEFAULT NULL COMMENT '导入的明细外部订单号',
  `charge_record_id` bigint(20) NOT NULL COMMENT '充值记录编号',
  `status` int(20) NOT NULL COMMENT '状态',
  `end_time` datetime DEFAULT NULL COMMENT '处理结束时间',
  `notify_count` int(20) NOT NULL COMMENT '通知次数',
  `next_notify_time` datetime NOT NULL COMMENT '下次通知时间',
  `notify_content` text COMMENT '通知内容',
  `notify_url` varchar(255) NOT NULL COMMENT '回调地址',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `charge_record_id_idx` (`charge_record_id`),
  KEY `status_idx` (`status`),
  KEY `import_biz_no_idx` (`import_biz_no`),
  KEY `app_id_idx` (`app_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='充值服务费通知回调表';

-- ----------------------------
-- Records of charge_record_notify_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for check_code
-- ----------------------------
DROP TABLE IF EXISTS `check_code`;
CREATE TABLE `check_code` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `mobile` varchar(16) NOT NULL COMMENT '手机号',
  `type` varchar(32) NOT NULL COMMENT '验证码类型',
  `related_id` bigint(20) DEFAULT NULL COMMENT '关联id',
  `code` varchar(16) NOT NULL COMMENT '验证码',
  `expired_time` datetime NOT NULL COMMENT '过期时间',
  `send_time` datetime NOT NULL COMMENT '发送时间',
  `error_cnt` bigint(20) NOT NULL COMMENT '出错的次数',
  `ip` varchar(32) DEFAULT NULL COMMENT '系统ip',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `related_id_idx` (`related_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='验证码';

-- ----------------------------
-- Records of check_code
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for check_code_log
-- ----------------------------
DROP TABLE IF EXISTS `check_code_log`;
CREATE TABLE `check_code_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `check_code_id` bigint(20) NOT NULL COMMENT 'check_code.id',
  `mobile` varchar(16) NOT NULL COMMENT '手机号',
  `type` varchar(32) NOT NULL COMMENT '验证码类型',
  `related_id` bigint(20) DEFAULT NULL COMMENT '关联id',
  `code` varchar(16) NOT NULL COMMENT '验证码',
  `expired_time` datetime NOT NULL COMMENT '过期时间',
  `send_time` datetime NOT NULL COMMENT '发送时间',
  `error_cnt` bigint(20) NOT NULL COMMENT '出错的次数',
  `valid` int(20) DEFAULT NULL COMMENT '是否被验证通过了',
  `ip` varchar(32) DEFAULT NULL COMMENT '系统ip',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `mobile_idx` (`mobile`),
  KEY `related_id_idx` (`related_id`),
  KEY `check_code_id_idx` (`check_code_id`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COMMENT='验证码记录表';
-- ----------------------------
-- Records of check_code_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for collection_safe_pay_channel
-- ----------------------------
DROP TABLE IF EXISTS `collection_safe_pay_channel`;
CREATE TABLE `collection_safe_pay_channel` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '商户编号',
  `uuid` varchar(32) NOT NULL COMMENT 'uuid',
  `name` varchar(128) NOT NULL COMMENT '收集渠道名',
  `url` varchar(128) NOT NULL COMMENT '收集链接',
  `qr_code` varchar(128) NOT NULL COMMENT '收集二维码',
  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uuid_idx` (`uuid`),
  KEY `user_id_idx` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='收集安全付渠道';

-- ----------------------------
-- Records of collection_safe_pay_channel
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for common_auto_pay_trans_batch
-- ----------------------------
DROP TABLE IF EXISTS `common_auto_pay_trans_batch`;
CREATE TABLE `common_auto_pay_trans_batch` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL COMMENT '用户编号',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `father_partner_id` bigint(20) DEFAULT NULL COMMENT '父级合伙人id',
  `status` varchar(32) NOT NULL COMMENT '状态',
  `biz_id` varchar(32) NOT NULL COMMENT '业务号',
  `alipay_user_id` bigint(20) DEFAULT NULL COMMENT '支付宝账号id',
  `alipay_nick_name` varchar(128) DEFAULT NULL COMMENT '支付宝账号',
  `mode` varchar(64) DEFAULT NULL COMMENT '服务费收费模式',
  `service_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费收费比例',
  `service_unit_price` bigint(20) DEFAULT NULL COMMENT '服务费单价 分',
  `service_price` bigint(20) DEFAULT NULL COMMENT '服务费 分',
  `refund` bigint(20) DEFAULT NULL COMMENT '服务费退款 分',
  `total_trans_amount` varchar(16) NOT NULL COMMENT '总金额 元',
  `total_count` bigint(20) NOT NULL COMMENT '总笔数',
  `success_amount` varchar(16) DEFAULT NULL COMMENT '成功金额 元',
  `success_count` bigint(20) DEFAULT NULL COMMENT '成功笔数',
  `failed_amount` varchar(16) DEFAULT NULL COMMENT '失败金额 元',
  `fail_count` bigint(20) DEFAULT NULL COMMENT '失败笔数',
  `batch_trans_id` varchar(64) DEFAULT NULL COMMENT '支付宝批次订单号',
  `last_pay_url` text COMMENT '最近一次pc付款链接',
  `last_mobile_pay_url` text COMMENT '最近一次移动端付款链接',
  `mobile_pay_qr_code` text COMMENT '最近一次二维码付款链接',
  `dealing_time` datetime DEFAULT NULL COMMENT '发起转账的时间',
  `end_time` datetime DEFAULT NULL COMMENT '完成时间',
  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
  `version` bigint(20) DEFAULT NULL COMMENT '版本号',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `user_id_idx` (`user_id`),
  KEY `biz_id_idx` (`biz_id`),
  KEY `end_time_idx` (`end_time`),
  KEY `dealing_time_status_idx` (`dealing_time`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of common_auto_pay_trans_batch
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for common_charge_record
-- ----------------------------
DROP TABLE IF EXISTS `common_charge_record`;
CREATE TABLE `common_charge_record` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL COMMENT '用户编号',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `father_partner_id` bigint(20) DEFAULT NULL COMMENT '父级合伙人id',
  `alipay_user_id` bigint(20) DEFAULT NULL COMMENT '支付宝账户id',
  `open_invoice_status` varchar(128) DEFAULT NULL COMMENT '开票状态',
  `alipay_nick_name` varchar(128) DEFAULT NULL COMMENT '支付宝账户',
  `out_biz_no` varchar(32) DEFAULT NULL COMMENT '外部交易号',
  `import_biz_no` varchar(128) DEFAULT NULL COMMENT '导入的明细外部订单号 非必选',
  `notify_url` varchar(128) DEFAULT NULL COMMENT '第三方回调地址',
  `time_expire` datetime DEFAULT NULL COMMENT '绝对超时时间，格式为 yyyy-MM-dd HH:mm:ss 非必选',
  `pay_status` varchar(64) NOT NULL COMMENT '支付状态',
  `last_pay_url` text COMMENT '支付链接',
  `last_mobile_pay_url` text COMMENT '最后一次发起的移动端付款链接',
  `mobile_pay_qr_code` varchar(255) DEFAULT NULL COMMENT '生成的移动端付款二维码',
  `amount` bigint(20) NOT NULL COMMENT '充值金额',
  `bill_pay_method` varchar(64) NOT NULL COMMENT '支付方式',
  `identity` varchar(128) NOT NULL COMMENT '收款方账号',
  `identity_type` varchar(128) NOT NULL COMMENT '收款方账号类型',
  `name` varchar(128) DEFAULT NULL COMMENT '收款方姓名',
  `end_time` datetime DEFAULT NULL COMMENT '完成时间',
  `batch_trans_id` varchar(128) DEFAULT NULL,
  `detail_id` varchar(64) DEFAULT NULL COMMENT '支付宝明细外部订单号',
  `error_code` varchar(100) DEFAULT NULL COMMENT '错误码',
  `error_msg` varchar(200) DEFAULT NULL COMMENT '错误原因',
  `memo` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `import_biz_no_idx` (`import_biz_no`),
  KEY `user_id_idx` (`user_id`),
  KEY `partner_id_idx` (`partner_id`),
  KEY `father_partner_id_idx` (`father_partner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='充值记录';

-- ----------------------------
-- Records of common_charge_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for common_collection_batch
-- ----------------------------
DROP TABLE IF EXISTS `common_collection_batch`;
CREATE TABLE `common_collection_batch` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL COMMENT '用户编号',
  `biz_id` varchar(128) NOT NULL COMMENT '业务号',
  `status` varchar(128) NOT NULL COMMENT '状态',
  `total_trans_amount` varchar(128) NOT NULL COMMENT '批次总金额，单位为元，精确到小数点后两位',
  `total_count` bigint(20) NOT NULL COMMENT '批次总笔数',
  `success_amount` varchar(128) DEFAULT NULL COMMENT '成功金额 单位为元',
  `success_count` bigint(20) DEFAULT NULL COMMENT '成功笔数',
  `failed_amount` varchar(128) DEFAULT NULL COMMENT '失败金额',
  `fail_count` bigint(20) DEFAULT NULL COMMENT '失败笔数',
  `batch_trans_id` varchar(128) DEFAULT NULL COMMENT '支付宝发起支付后返回的 支付宝批次订单号',
  `last_pay_url` text COMMENT '最后一次发起的付款链接',
  `dealing_time` datetime DEFAULT NULL COMMENT '处理开始时间',
  `end_time` datetime DEFAULT NULL COMMENT '完成时间',
  `order_ids` longtext COMMENT '编号集合',
  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
  `version` bigint(20) NOT NULL COMMENT '版本号',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `biz_id_idx` (`biz_id`),
  KEY `end_time_idx` (`end_time`),
  KEY `create_time_idx` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='收集收款转账批次';

-- ----------------------------
-- Records of common_collection_batch
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for common_pay_trans_batch
-- ----------------------------
DROP TABLE IF EXISTS `common_pay_trans_batch`;
CREATE TABLE `common_pay_trans_batch` (
  `id` bigint(20) NOT NULL,
  `version` bigint(20) NOT NULL COMMENT '版本号',
  `user_id` bigint(20) NOT NULL COMMENT '用户编号',
  `mobile` varchar(16) NOT NULL COMMENT '注册手机号',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `father_partner_id` bigint(20) DEFAULT NULL COMMENT '父级合伙人id',
  `salesman_id` bigint(20) DEFAULT NULL COMMENT '销售id',
  `free` int(20) NOT NULL DEFAULT '0' COMMENT '是否是免费批次',
  `other_trans` int(20) NOT NULL DEFAULT '0' COMMENT '其他人代转账',
  `execute_user_id` bigint(20) DEFAULT NULL COMMENT '转账执行用户id',
  `execute_outer_id` varchar(64) DEFAULT NULL COMMENT '转账执行外部用户编号',
  `execute_mobile` varchar(128) DEFAULT NULL COMMENT '转账执行用户手机号',
  `has_pay_service` int(20) DEFAULT NULL COMMENT '有无支付手续费',
  `alipay_user_id` bigint(20) DEFAULT NULL COMMENT '支付宝账号id',
  `alipay_nick_name` varchar(128) DEFAULT NULL COMMENT '支付宝账号',
  `import_batch_no` varchar(30) NOT NULL COMMENT '外部导入订单号',
  `batch_trans_id` varchar(64) DEFAULT NULL COMMENT '支付宝批次订单号',
  `last_summary_id` bigint(20) DEFAULT NULL COMMENT '最近一次交易汇总id',
  `last_pay_url` text COMMENT '最近一次付款链接',
  `last_mobile_pay_url` text COMMENT '最近一次付款移动端链接',
  `mobile_pay_qr_code` varchar(255) DEFAULT NULL COMMENT '移动端支付二维码链接',
  `file_url` varchar(512) DEFAULT NULL COMMENT '文件链接',
  `file_expired` datetime DEFAULT NULL COMMENT '文件链接过期时间',
  `service_price` bigint(20) NOT NULL COMMENT '服务费 分',
  `refund` bigint(20) DEFAULT NULL COMMENT '服务费退款 分',
  `mode` varchar(64) DEFAULT NULL COMMENT '服务费收费模式',
  `commission_mode` varchar(64) DEFAULT NULL COMMENT '分佣模式',
  `service_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费收费比例',
  `service_unit_price` bigint(20) NOT NULL COMMENT '服务费单价 分',
  `service_real_price` bigint(20) NOT NULL COMMENT '实际服务费单价 分',
  `total_trans_amount` varchar(16) NOT NULL COMMENT '总金额 元',
  `total_count` bigint(20) NOT NULL COMMENT '总笔数',
  `success_amount` varchar(16) DEFAULT NULL COMMENT '成功金额 元',
  `success_count` bigint(20) DEFAULT NULL COMMENT '成功笔数',
  `failed_amount` varchar(16) DEFAULT NULL COMMENT '失败金额 元',
  `fail_count` bigint(20) DEFAULT NULL COMMENT '失败笔数',
  `order_title` varchar(64) NOT NULL COMMENT '打款标题',
  `remark` varchar(200) DEFAULT NULL COMMENT '打款备注',
  `status` varchar(64) NOT NULL COMMENT '状态',
  `end_time` datetime DEFAULT NULL COMMENT '完成时间',
  `time_expire` varchar(16) DEFAULT NULL COMMENT '绝对超时时间，格式为yyyy-MM-dd HH:mm。',
  `unit_partner_benefit` bigint(20) DEFAULT NULL COMMENT '合伙人单笔收益 分',
  `unit_father_partner_benefit` bigint(20) DEFAULT NULL COMMENT '父级合伙人单笔收益 分',
  `benefit_ratio` decimal(19,4) DEFAULT NULL COMMENT '合伙人毛利润分佣比例',
  `father_benefit_ratio` decimal(19,4) DEFAULT NULL COMMENT '父合伙人毛利润分佣比例',
  `cost_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费成本价收费比例',
  `total_partner_benefit` bigint(20) DEFAULT NULL COMMENT '合伙人总收益 分',
  `total_father_partner_benefit` bigint(20) DEFAULT NULL COMMENT '父级合伙人总收益 分',
  `total_platform_benefit` bigint(20) DEFAULT NULL COMMENT '平台总收益 分',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `user_id_import_batch_no_idx` (`user_id`,`import_batch_no`),
  KEY `user_id_idx` (`user_id`),
  KEY `mobile_idx` (`mobile`),
  KEY `end_time_idx` (`end_time`),
  KEY `partner_id_idx` (`partner_id`),
  KEY `father_partner_id_idx` (`father_partner_id`),
  KEY `execute_user_id_idx` (`execute_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='转账批次聚合表';

-- ----------------------------
-- Records of common_pay_trans_batch
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for common_safe_pay_batch
-- ----------------------------
DROP TABLE IF EXISTS `common_safe_pay_batch`;
CREATE TABLE `common_safe_pay_batch` (
  `id` bigint(20) NOT NULL,
  `version` bigint(20) NOT NULL COMMENT '版本号',
  `user_id` bigint(20) NOT NULL COMMENT '用户编号',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `father_partner_id` bigint(20) DEFAULT NULL COMMENT '父级合伙人id',
  `salesman_id` bigint(20) DEFAULT NULL COMMENT '销售id',
  `free` int(20) NOT NULL DEFAULT '0' COMMENT '是否是免费批次',
  `need_notify` int(20) DEFAULT NULL COMMENT '是否需要推送',
  `type` int(20) NOT NULL DEFAULT '1' COMMENT '收款类型 1.支付宝 2.银行卡',
  `alipay_nick_name` varchar(32) NOT NULL COMMENT '支付宝账号',
  `safe_pay_book_account_id` bigint(20) NOT NULL COMMENT 'safe_pay_book_account_id',
  `book_id` varchar(128) NOT NULL COMMENT '资金账本id',
  `file_url` varchar(512) DEFAULT NULL COMMENT '文件链接',
  `file_expired` datetime DEFAULT NULL COMMENT '文件链接过期时间',
  `agreement_no` varchar(128) NOT NULL COMMENT '签约协议号',
  `import_batch_no` varchar(128) NOT NULL COMMENT '外部批次号',
  `has_pay_service` int(20) NOT NULL COMMENT '有无预扣服务费',
  `need_ensure` int(20) NOT NULL COMMENT '是否需要短信验证',
  `service_price` bigint(20) DEFAULT NULL COMMENT '服务费 单位分',
  `refund` bigint(20) DEFAULT NULL COMMENT '服务费退款 单位分',
  `final_service_price` bigint(20) DEFAULT NULL COMMENT '去掉退款后的最终服务费 分',
  `mode` varchar(64) DEFAULT NULL COMMENT '服务费收费模式',
  `commission_mode` varchar(64) DEFAULT NULL COMMENT '分佣模式',
  `service_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费收费比例',
  `service_unit_price` bigint(20) NOT NULL COMMENT '服务费单价 分',
  `total_trans_amount` decimal(19,2) NOT NULL COMMENT '总金额 元',
  `total_count` bigint(20) NOT NULL COMMENT '总笔数',
  `success_amount` decimal(19,2) DEFAULT NULL COMMENT '成功金额 元',
  `success_count` bigint(20) DEFAULT NULL COMMENT '成功笔数',
  `failed_amount` decimal(19,2) DEFAULT NULL COMMENT '失败金额 元',
  `fail_count` bigint(20) DEFAULT NULL COMMENT '失败笔数',
  `status` varchar(64) NOT NULL COMMENT '状态',
  `start_time` datetime DEFAULT NULL COMMENT '确认转账时间',
  `end_time` datetime DEFAULT NULL COMMENT '完成时间',
  `unit_partner_benefit` bigint(20) DEFAULT NULL COMMENT '合伙人单笔收益 分',
  `unit_father_partner_benefit` bigint(20) DEFAULT NULL COMMENT '父级合伙人单笔收益 分',
  `benefit_ratio` decimal(19,4) DEFAULT NULL COMMENT '合伙人毛利润分佣比例',
  `father_benefit_ratio` decimal(19,4) DEFAULT NULL COMMENT '父合伙人毛利润分佣比例',
  `cost_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费成本价收费比例',
  `total_partner_benefit` bigint(20) DEFAULT NULL COMMENT '合伙人总收益 分',
  `total_father_partner_benefit` bigint(20) DEFAULT NULL COMMENT '父级合伙人总收益 分',
  `total_platform_benefit` bigint(20) DEFAULT NULL COMMENT '平台总收益 分',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `user_id_import_batch_no_idx` (`user_id`,`import_batch_no`),
  KEY `end_time_idx` (`end_time`),
  KEY `partner_id_idx` (`partner_id`),
  KEY `father_partner_id_idx` (`father_partner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='同步安全付转账批次表';

-- ----------------------------
-- Records of common_safe_pay_batch
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for common_sys_config
-- ----------------------------
DROP TABLE IF EXISTS `common_sys_config`;
CREATE TABLE `common_sys_config` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `version` bigint(20) NOT NULL,
  `key` varchar(128) NOT NULL COMMENT '键',
  `value` varchar(1024) NOT NULL COMMENT '值',
  `value_type` varchar(64) NOT NULL COMMENT '值类型',
  `note` varchar(128) NOT NULL COMMENT '备注',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `key_idx` (`key`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of common_sys_config
-- ----------------------------
BEGIN;
INSERT INTO `common_sys_config` VALUES (1, 0, 'merchant_domain', 'pay.test.com', 'string', '商户端域名', '2021-07-22 18:03:56', '2021-07-22 18:03:56');
INSERT INTO `common_sys_config` VALUES (2, 0, 'partner_withdraw_alipay_account', '', 'string', '推广提现打款支付宝账号', '2021-07-22 18:03:56', '2021-07-22 18:03:56');
INSERT INTO `common_sys_config` VALUES (3, 0, 'partner_withdraw_mobile', '', 'string', '推广提现打款手机账户', '2021-07-22 18:03:57', '2021-07-22 18:03:57');
INSERT INTO `common_sys_config` VALUES (4, 1, 'open_register', '1', 'number', '是否开放注册', '2021-07-22 18:03:58', '2021-07-22 18:03:58');
INSERT INTO `common_sys_config` VALUES (5, 1, 'open_alipay_account_day_limit', '1', 'number', '是否开启日限额', '2021-07-22 18:03:58', '2021-07-22 18:03:58');
INSERT INTO `common_sys_config` VALUES (6, 1, 'pause_stable_service', '0', 'number', '稳定型服务暂停运行', '2021-07-22 18:03:59', '2021-07-22 18:03:59');
INSERT INTO `common_sys_config` VALUES (7, 1, 'alipay_account_day_limit_amount', '200000', 'number', '日限额', '2020-08-31 15:28:15', '2020-08-31 15:28:15');
INSERT INTO `common_sys_config` VALUES (8, 0, 'default_partner_settle_rule', '[{\"min\": 0, \"max\" :20000,\"ratio\":0.25}, {\"min\":20000, \"max\": 30000, \"ratio\":0.3}, {\"min\":30000, \"max\":null, \"ratio\":0.35}]', 'string', '默认的渠道分佣规则', '2022-03-03 00:00:00', '2022-03-03 00:00:00');
INSERT INTO `common_sys_config` VALUES (9, 1, 'query_safe_pay_order_delay_time', '5', 'number', '安全付支付结果超时查询时间（单位分）', '2020-08-31 15:28:15', '2020-08-31 15:28:15');
INSERT INTO `common_sys_config` VALUES (10, 1, 'open_safe_pay_bank', '1', 'number', '是否开放安全付到卡', '2023-04-19 16:39:00', '2024-01-03 13:51:10');
INSERT INTO `common_sys_config` VALUES (11, 3, 'partner_withdraw_safe_pay_account', 'test@163.com', 'string', '推广提现打款安全付支付宝账号', '2020-08-31 15:28:15', '2024-02-02 17:35:50');
INSERT INTO `common_sys_config` VALUES (12, 1, 'open_safe_pay_new_sign_method', '0', 'number', '是否开放安全发签约授权新方式', '2020-08-31 15:28:15', '2020-08-31 15:28:15');
INSERT INTO `common_sys_config` VALUES (13, 1, 'singe_trans_bank_cost_ratio', '0.0005', 'string', '单笔到卡手续费成本费率', '2020-08-31 15:28:15', '2020-08-31 15:28:15');
INSERT INTO `common_sys_config` VALUES (14, 1, 'open_domain', 'pay.test.com', 'string', '开放平台域名', '2020-08-31 15:28:15', '2020-08-31 15:28:15');
INSERT INTO `common_sys_config` VALUES (15, 1, 'partner_domain', 'pay.test.com', 'string', '合伙人端域名', '2020-08-31 15:28:15', '2020-08-31 15:28:15');
INSERT INTO `common_sys_config` VALUES (16, 1, 'short_domain', 'pay.test.com', 'string', '短链接域名', '2020-08-31 15:28:15', '2020-08-31 15:28:15');
INSERT INTO `common_sys_config` VALUES (17, 1, 'openapi_domain', 'pay.test.com', 'string', '开放接口网关域名', '2020-08-31 15:28:15', '2020-08-31 15:28:15');
COMMIT;

-- ----------------------------
-- Table structure for common_user_withdraw_record
-- ----------------------------
DROP TABLE IF EXISTS `common_user_withdraw_record`;
CREATE TABLE `common_user_withdraw_record` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户编号',
  `biz_no` varchar(128) DEFAULT NULL COMMENT '业务id 携带分库信息 userId-id',
  `alipay_user_id` bigint(20) DEFAULT NULL COMMENT '支付宝id',
  `pay_status` varchar(128) DEFAULT NULL COMMENT '提现状态',
  `error_code` varchar(128) DEFAULT NULL COMMENT '明细失败错误码',
  `error_msg` varchar(128) DEFAULT NULL COMMENT '明细失败错误原因',
  `transfer_money` bigint(20) DEFAULT NULL COMMENT '转账金额 单位分',
  `end_time` datetime DEFAULT NULL COMMENT '系统转账时间或者关闭时间',
  `real_name` varchar(128) DEFAULT NULL COMMENT '真实姓名',
  `alipay_nick_name` varchar(128) DEFAULT NULL COMMENT '支付宝账号',
  `version` bigint(20) DEFAULT NULL,
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of common_user_withdraw_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for company_bill_daily_stat
-- ----------------------------
DROP TABLE IF EXISTS `company_bill_daily_stat`;
CREATE TABLE `company_bill_daily_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `day` date NOT NULL COMMENT '日期',
  `recharge_amount` bigint(20) NOT NULL COMMENT '正向充值金额 分',
  `reverse_recharge_amount` bigint(20) NOT NULL COMMENT '逆向充值金额 分',
  `success_service_price` bigint(20) NOT NULL COMMENT '成功服务费 分',
  `real_success_service_price` bigint(20) NOT NULL COMMENT '实际成功服务费 分',
  `total_partner_benefit` bigint(20) NOT NULL COMMENT '合伙人总收益 分',
  `total_father_partner_benefit` bigint(20) NOT NULL COMMENT '父级合伙人总收益 分',
  `total_platform_benefit` bigint(20) NOT NULL COMMENT '平台总收益 分',
  `safe_pay_success_service_price` bigint(20) NOT NULL COMMENT '安全付成功服务费 分',
  `safe_pay_total_partner_benefit` bigint(20) NOT NULL COMMENT '安全付合伙人总收益 分',
  `safe_pay_total_father_partner_benefit` bigint(20) NOT NULL COMMENT '安全付父级合伙人总收益 分',
  `safe_pay_total_platform_benefit` bigint(20) NOT NULL COMMENT '安全付平台总收益 分',
  `safe_pay_success_amount` decimal(19,2) NOT NULL COMMENT '安全付成功转账金额 元',
  `safe_pay_success_count` bigint(20) NOT NULL COMMENT '安全付成功转账笔数',
  `safe_pay_trans_success_bank_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账到卡金额 单位元 保留2小数',
  `estimate_charge_cost` decimal(19,2) DEFAULT NULL COMMENT '充值服务费预估成本 单位元 保留2小数',
  `estimate_bank_cost` decimal(19,2) DEFAULT NULL COMMENT '到卡服务费预估成本 单位元 保留2小数',
  `partner_withdraw_amount` bigint(20) NOT NULL COMMENT '合伙人提现金额 分',
  `user_withdraw_amount` bigint(20) NOT NULL COMMENT '商户提现金额 分',
  `success_amount` decimal(19,2) NOT NULL COMMENT '成功转账金额 元',
  `success_count` bigint(20) NOT NULL COMMENT '成功转账笔数',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `day_idx` (`day`)
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=utf8 COMMENT='公司日账单';

-- ----------------------------
-- Records of company_bill_daily_stat
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for company_daily_stat
-- ----------------------------
DROP TABLE IF EXISTS `company_daily_stat`;
CREATE TABLE `company_daily_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `day` date NOT NULL COMMENT '日期',
  `register_count` bigint(20) DEFAULT NULL COMMENT '新入驻商户数',
  `service_charge_fee` decimal(19,2) DEFAULT NULL COMMENT '服务费充值金额 单位元 保留2小数',
  `total_count` bigint(20) DEFAULT NULL COMMENT '总转账笔数',
  `total_success_count` bigint(20) DEFAULT NULL COMMENT '总转账成功笔数',
  `total_fail_count` bigint(20) DEFAULT NULL COMMENT '总转账失败笔数',
  `total_success_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 总转账成功笔数',
  `total_fail_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 总转账失败笔数',
  `total_service_price` decimal(19,2) DEFAULT NULL COMMENT '总服务费支出 单位元 保留2小数',
  `total_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账金额 单位元 保留2小数',
  `total_trans_bank_amount` decimal(19,2) DEFAULT NULL COMMENT '到卡总转账金额',
  `total_trans_alipay_amount` decimal(19,2) DEFAULT NULL COMMENT '到支付宝总转账金额',
  `total_success_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账成功金额 单位元 保留2小数',
  `total_success_trans_bank_amount` decimal(19,2) DEFAULT NULL COMMENT '到卡总转账成功金额',
  `total_success_trans_alipay_amount` decimal(19,2) DEFAULT NULL COMMENT '到支付宝总转账成功金额',
  `total_fail_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账失败金额 单位元 保留2小数',
  `total_benefit` decimal(19,2) DEFAULT NULL COMMENT '平台服务费总收益 单位元 保留2小数',
  `pay_trans_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账笔数',
  `pay_trans_success_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账成功笔数',
  `pay_trans_fail_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账失败笔数',
  `pay_trans_very_alipay_user_count` bigint(20) DEFAULT NULL COMMENT '批量有密付款超过500万的账户数',
  `pay_trans_success_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 批量有密转账成功笔数',
  `pay_trans_fail_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 批量有密转账失败笔数',
  `pay_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账金额 单位元 保留2小数',
  `pay_trans_success_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账成功金额 单位元 保留2小数',
  `pay_trans_fail_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账失败金额 单位元 保留2小数',
  `pay_trans_service_price` decimal(19,2) DEFAULT NULL COMMENT '批量有密服务费支出 单位元 保留2小数',
  `total_pay_trans_benefit` decimal(19,2) DEFAULT NULL COMMENT '平台服务费总收益(批量有密) 单位元 保留2小数',
  `pay_trans_active_user_count` bigint(20) DEFAULT NULL COMMENT '批量有密活跃商户数',
  `pay_trans_active_partner_count` bigint(20) DEFAULT NULL COMMENT '批量有密活跃渠道数',
  `pay_trans_payer_alipay_account_count` bigint(20) DEFAULT NULL COMMENT '批量有密付款支付宝账户数',
  `pay_trans_payee_alipay_account_count` bigint(20) DEFAULT NULL COMMENT '批量有密收款支付宝账户数',
  `safe_pay_trans_count` bigint(20) DEFAULT NULL COMMENT '安全发转账笔数',
  `safe_pay_trans_success_count` bigint(20) DEFAULT NULL COMMENT '安全发成功转账笔数',
  `safe_pay_trans_fail_count` bigint(20) DEFAULT NULL COMMENT '安全发失败转账笔数',
  `safe_pay_trans_very_alipay_user_count` bigint(20) DEFAULT NULL COMMENT '安全发款超过500万的账户数',
  `safe_pay_trans_success_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 安全发成功转账笔数',
  `safe_pay_trans_fail_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 安全发失败转账笔数',
  `safe_pay_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账金额 单位元 保留2小数',
  `safe_pay_trans_bank_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账到卡金额 单位元 保留2小数',
  `safe_pay_trans_alipay_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账到支付宝金额 单位元 保留2小数',
  `safe_pay_trans_success_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账成功金额 单位元 保留2小数',
  `safe_pay_trans_success_bank_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账到卡金额 单位元 保留2小数',
  `safe_pay_trans_success_alipay_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账到支付宝金额 单位元 保留2小数',
  `safe_pay_trans_fail_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账失败金额 单位元 保留2小数',
  `safe_pay_trans_service_price` decimal(19,2) DEFAULT NULL COMMENT '安全发服务费支出 单位元 保留2小数',
  `total_safe_pay_trans_benefit` decimal(19,2) DEFAULT NULL COMMENT '平台服务费总收益(安全发) 单位元 保留2小数',
  `safe_pay_active_user_count` bigint(20) DEFAULT NULL COMMENT '安全发活跃商户数',
  `safe_pay_active_partner_count` bigint(20) DEFAULT NULL COMMENT '安全发活跃渠道数',
  `safe_pay_payer_alipay_account_count` bigint(20) DEFAULT NULL COMMENT '安全发付款支付宝账户数',
  `safe_pay_payee_alipay_account_count` bigint(20) DEFAULT NULL COMMENT '安全发收款支付宝账户数',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `day_idx` (`day`)
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=utf8mb4 COMMENT='后台经营数据表';

-- ----------------------------
-- Records of company_daily_stat
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for company_real_time_stat
-- ----------------------------
DROP TABLE IF EXISTS `company_real_time_stat`;
CREATE TABLE `company_real_time_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `update_time` datetime NOT NULL COMMENT '更新时间',
  `register_count` bigint(20) DEFAULT NULL COMMENT '新入驻商户数',
  `service_charge_fee` decimal(19,2) DEFAULT NULL COMMENT '服务费充值金额 单位元 保留2小数',
  `total_count` bigint(20) DEFAULT NULL COMMENT '总转账笔数',
  `total_success_count` bigint(20) DEFAULT NULL COMMENT '总转账成功笔数',
  `total_fail_count` bigint(20) DEFAULT NULL COMMENT '总转账失败笔数',
  `total_success_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 总转账成功笔数',
  `total_fail_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 总转账失败笔数',
  `total_service_price` decimal(19,2) DEFAULT NULL COMMENT '总服务费支出 单位元 保留2小数',
  `total_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账金额 单位元 保留2小数',
  `total_trans_bank_amount` decimal(19,2) DEFAULT NULL COMMENT '到卡总转账金额',
  `total_trans_alipay_amount` decimal(19,2) DEFAULT NULL COMMENT '到支付宝总转账金额',
  `total_success_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账成功金额 单位元 保留2小数',
  `total_success_trans_bank_amount` decimal(19,2) DEFAULT NULL COMMENT '到卡总转账成功金额',
  `total_success_trans_alipay_amount` decimal(19,2) DEFAULT NULL COMMENT '到支付宝总转账成功金额',
  `total_fail_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账失败金额 单位元 保留2小数',
  `total_benefit` decimal(19,2) DEFAULT NULL COMMENT '平台服务费总收益 单位元 保留2小数',
  `pay_trans_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账笔数',
  `pay_trans_success_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账成功笔数',
  `pay_trans_fail_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账失败笔数',
  `pay_trans_very_alipay_user_count` bigint(20) DEFAULT NULL COMMENT '批量有密付款超过500万的账户数',
  `pay_trans_success_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 批量有密转账成功笔数',
  `pay_trans_fail_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 批量有密转账失败笔数',
  `pay_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账金额 单位元 保留2小数',
  `pay_trans_success_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账成功金额 单位元 保留2小数',
  `pay_trans_fail_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账失败金额 单位元 保留2小数',
  `pay_trans_service_price` decimal(19,2) DEFAULT NULL COMMENT '批量有密服务费支出 单位元 保留2小数',
  `total_pay_trans_benefit` decimal(19,2) DEFAULT NULL COMMENT '平台服务费总收益(批量有密) 单位元 保留2小数',
  `pay_trans_active_user_count` bigint(20) DEFAULT NULL COMMENT '批量有密活跃商户数',
  `pay_trans_active_partner_count` bigint(20) DEFAULT NULL COMMENT '批量有密活跃渠道数',
  `pay_trans_payer_alipay_account_count` bigint(20) DEFAULT NULL COMMENT '批量有密付款支付宝账户数',
  `pay_trans_payee_alipay_account_count` bigint(20) DEFAULT NULL COMMENT '批量有密收款支付宝账户数',
  `safe_pay_trans_count` bigint(20) DEFAULT NULL COMMENT '安全发转账笔数',
  `safe_pay_trans_success_count` bigint(20) DEFAULT NULL COMMENT '安全发成功转账笔数',
  `safe_pay_trans_fail_count` bigint(20) DEFAULT NULL COMMENT '安全发失败转账笔数',
  `safe_pay_trans_very_alipay_user_count` bigint(20) DEFAULT NULL COMMENT '安全发款超过500万的账户数',
  `safe_pay_trans_success_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 安全发成功转账笔数',
  `safe_pay_trans_fail_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 安全发失败转账笔数',
  `safe_pay_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账金额 单位元 保留2小数',
  `safe_pay_trans_bank_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账到卡金额 单位元 保留2小数',
  `safe_pay_trans_alipay_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账到支付宝金额 单位元 保留2小数',
  `safe_pay_trans_success_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账成功金额 单位元 保留2小数',
  `safe_pay_trans_success_bank_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账到卡金额 单位元 保留2小数',
  `safe_pay_trans_success_alipay_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账到支付宝金额 单位元 保留2小数',
  `safe_pay_trans_fail_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账失败金额 单位元 保留2小数',
  `safe_pay_trans_service_price` decimal(19,2) DEFAULT NULL COMMENT '安全发服务费支出 单位元 保留2小数',
  `total_safe_pay_trans_benefit` decimal(19,2) DEFAULT NULL COMMENT '平台服务费总收益(安全发) 单位元 保留2小数',
  `safe_pay_active_user_count` bigint(20) DEFAULT NULL COMMENT '安全发活跃商户数',
  `safe_pay_active_partner_count` bigint(20) DEFAULT NULL COMMENT '安全发活跃渠道数',
  `safe_pay_payer_alipay_account_count` bigint(20) DEFAULT NULL COMMENT '安全发付款支付宝账户数',
  `safe_pay_payee_alipay_account_count` bigint(20) DEFAULT NULL COMMENT '安全发收款支付宝账户数',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='公司经营数据包';

-- ----------------------------
-- Records of company_real_time_stat
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for daily_task_record
-- ----------------------------
DROP TABLE IF EXISTS `daily_task_record`;
CREATE TABLE `daily_task_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `task_name` varchar(128) NOT NULL COMMENT '任务名',
  `day` date NOT NULL COMMENT '日期',
  `is_manual_task` int(20) NOT NULL COMMENT '是否是手动任务 0不是 1是',
  `task_status` varchar(128) NOT NULL COMMENT '任务状态',
  `total_count` bigint(20) NOT NULL COMMENT '总数量',
  `success_count` bigint(20) NOT NULL COMMENT '成功数',
  `failed_count` bigint(20) NOT NULL COMMENT '失败数',
  `process_count` bigint(20) NOT NULL COMMENT '已处理数',
  `start_time` datetime NOT NULL COMMENT '处理开始时间',
  `end_time` datetime DEFAULT NULL,
  `error_code` varchar(2048) DEFAULT NULL,
  `error_message` varchar(2048) DEFAULT NULL,
  `ip` varchar(128) DEFAULT NULL,
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `task_name` (`task_name`,`day`),
  KEY `task_name_2` (`task_name`,`task_status`)
) ENGINE=InnoDB AUTO_INCREMENT=5959 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of daily_task_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for data_snap
-- ----------------------------
DROP TABLE IF EXISTS `data_snap`;
CREATE TABLE `data_snap` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `data` longtext COMMENT '数据快照 json格式',
  `type` varchar(64) DEFAULT NULL COMMENT '类型',
  `related_id` bigint(20) DEFAULT NULL COMMENT '关联id',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='重要数据快照表';

-- ----------------------------
-- Records of data_snap
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for delivery_address
-- ----------------------------
DROP TABLE IF EXISTS `delivery_address`;
CREATE TABLE `delivery_address` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL,
  `recipient_name` varchar(128) DEFAULT NULL COMMENT '收件人姓名',
  `province` varchar(128) DEFAULT NULL COMMENT '省',
  `city` varchar(128) DEFAULT NULL COMMENT '市',
  `district` varchar(128) DEFAULT NULL COMMENT '区',
  `detailed_address` varchar(128) DEFAULT NULL COMMENT '详细地址',
  `contacts_phone` varchar(128) DEFAULT NULL COMMENT '联系人手机号',
  `delivery_address_type` int(20) DEFAULT NULL COMMENT '默认地址/非默认地址',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id_idx` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of delivery_address
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for flexible_staff_authentication
-- ----------------------------
DROP TABLE IF EXISTS `flexible_staff_authentication`;
CREATE TABLE `flexible_staff_authentication` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `alipay_uid` varchar(128) DEFAULT NULL COMMENT '支付宝uid',
  `identity` varchar(64) NOT NULL COMMENT '主体账号',
  `identity_type` varchar(32) NOT NULL COMMENT '主体账号类型',
  `identity_name` varchar(128) DEFAULT NULL COMMENT '主体账号名称',
  `import_biz_no` varchar(64) DEFAULT NULL COMMENT '第三方订单号',
  `out_biz_no` varchar(64) NOT NULL COMMENT '外部订单号',
  `card_status` int(20) NOT NULL COMMENT '零工卡开卡状态',
  `employee_card_no` varchar(128) DEFAULT NULL COMMENT '零工卡号',
  `open_card_time` datetime DEFAULT NULL COMMENT '开卡时间',
  `alipay_logon_id` varchar(64) DEFAULT NULL COMMENT '登录的支付宝账号（不保证不被模糊处理）',
  `apply_link` varchar(255) DEFAULT NULL COMMENT '开通链接',
  `flow_token` varchar(255) DEFAULT NULL COMMENT '申请的流程实例ID',
  `mini_app_apply_link` varchar(512) DEFAULT NULL COMMENT '小程序开通链接',
  `apply_link_expire_time` datetime DEFAULT NULL COMMENT '链接失效时间',
  `verify_result` varchar(16) DEFAULT NULL COMMENT '验证结果',
  `verify_time` datetime DEFAULT NULL COMMENT '验证时间',
  `notify_url` varchar(255) DEFAULT NULL COMMENT '通知地址',
  `return_url` varchar(255) DEFAULT NULL COMMENT '回跳地址',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `out_biz_no_idx` (`out_biz_no`),
  UNIQUE KEY `import_biz_no_user_id` (`import_biz_no`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='零工视频核验';

-- ----------------------------
-- Records of flexible_staff_authentication
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for flexible_staff_authentication_notify_record
-- ----------------------------
DROP TABLE IF EXISTS `flexible_staff_authentication_notify_record`;
CREATE TABLE `flexible_staff_authentication_notify_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `import_biz_no` varchar(64) NOT NULL COMMENT '第三方订单号',
  `flexible_staff_authentication_id` bigint(20) NOT NULL COMMENT '核验单号',
  `status` int(20) NOT NULL COMMENT '通知状态',
  `end_time` datetime DEFAULT NULL COMMENT '通知处理完成等最终状态时间',
  `notify_url` varchar(255) NOT NULL COMMENT '回调地址',
  `notify_count` int(20) NOT NULL COMMENT '通知次数 8次（第8次通知完直接status跟新为死信通知人工处理）',
  `next_notify_time` datetime NOT NULL COMMENT '下次通知时间 0m 2m,10m,10m,1h,2h,6h,15h',
  `notify_content` text NOT NULL COMMENT '通知的json字符串',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='零工卡视频核验推送记录';

-- ----------------------------
-- Records of flexible_staff_authentication_notify_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for flexible_staff_card
-- ----------------------------
DROP TABLE IF EXISTS `flexible_staff_card`;
CREATE TABLE `flexible_staff_card` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户编号',
  `alipay_uid` varchar(128) DEFAULT NULL COMMENT '支付宝uid',
  `identity` varchar(32) NOT NULL COMMENT '开卡方账号',
  `identity_type` varchar(32) NOT NULL COMMENT '开卡方账号类型',
  `identity_name` varchar(128) DEFAULT NULL COMMENT '开卡方账号名称',
  `import_biz_no` varchar(64) DEFAULT NULL COMMENT '第三方订单号',
  `out_biz_no` varchar(64) NOT NULL COMMENT '外部订单号',
  `employee_card_no` varchar(128) DEFAULT NULL COMMENT '零工卡号',
  `book_id` varchar(128) DEFAULT NULL COMMENT '资金账本id',
  `book_status` int(20) NOT NULL COMMENT '资金账本状态',
  `agreement_no` varchar(128) DEFAULT NULL COMMENT '签约协议号',
  `open_card_time` datetime DEFAULT NULL COMMENT '开通卡时间',
  `sign_time` datetime DEFAULT NULL COMMENT '协议签约时间',
  `un_sign_time` datetime DEFAULT NULL COMMENT '协议解约时间',
  `agreement_status` varchar(8) NOT NULL COMMENT '协议状态',
  `inviter_identity` varchar(32) NOT NULL COMMENT '邀请方账号',
  `inviter_identity_type` varchar(32) NOT NULL COMMENT '邀请方账号类型',
  `inviter_identity_name` varchar(128) DEFAULT NULL COMMENT '邀请方账号名称',
  `hire_identity` varchar(32) NOT NULL COMMENT '雇佣方账号',
  `hire_identity_type` varchar(32) NOT NULL COMMENT '雇佣方账号类型',
  `hire_identity_name` varchar(128) DEFAULT NULL COMMENT '雇佣方账号名称',
  `capital_identity` varchar(32) DEFAULT NULL COMMENT '资方账号',
  `capital_identity_type` varchar(32) DEFAULT NULL COMMENT '资方账号类型',
  `capital_identity_name` varchar(128) DEFAULT NULL COMMENT '资方账号名称',
  `has_capital` int(20) NOT NULL COMMENT '存在资方概念 限定还款对象为资方 1.有 0.无',
  `repayment_amount` bigint(20) DEFAULT NULL COMMENT '每月可还款金额 单位元',
  `repayment_end_time` varchar(128) DEFAULT NULL COMMENT '还款协议截止时间',
  `apply_link` varchar(255) DEFAULT NULL COMMENT '开通链接',
  `flow_token` varchar(255) DEFAULT NULL COMMENT '申请的流程实例ID',
  `apply_link_expire_time` datetime DEFAULT NULL COMMENT '开通链接过期时间',
  `notify_url` varchar(255) DEFAULT NULL COMMENT '通知地址',
  `return_url` varchar(255) DEFAULT NULL COMMENT '回跳地址',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `out_biz_no_idx` (`out_biz_no`),
  UNIQUE KEY `identity_user_id_hire_identity_idx` (`identity`,`user_id`,`hire_identity`),
  UNIQUE KEY `import_biz_no_user_id` (`import_biz_no`,`user_id`),
  UNIQUE KEY `agreement_no_idx` (`agreement_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='零工卡';

-- ----------------------------
-- Records of flexible_staff_card
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for flexible_staff_card_notify_record
-- ----------------------------
DROP TABLE IF EXISTS `flexible_staff_card_notify_record`;
CREATE TABLE `flexible_staff_card_notify_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `import_biz_no` varchar(64) NOT NULL COMMENT '第三方订单号',
  `flexible_staff_card_id` bigint(20) NOT NULL COMMENT '灵工卡号',
  `status` int(20) NOT NULL COMMENT '通知状态',
  `end_time` datetime DEFAULT NULL COMMENT '通知处理完成等最终状态时间',
  `notify_url` varchar(255) NOT NULL COMMENT '回调地址',
  `notify_count` int(20) NOT NULL COMMENT '通知次数 8次（第8次通知完直接status跟新为死信通知人工处理）',
  `next_notify_time` datetime NOT NULL COMMENT '下次通知时间 0m 2m,10m,10m,1h,2h,6h,15h',
  `notify_content` text NOT NULL COMMENT '通知的json字符串',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `status_idx` (`status`),
  KEY `import_biz_no_idx` (`import_biz_no`),
  KEY `end_time_idx` (`end_time`),
  KEY `next_notify_time_idx` (`next_notify_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='灵工卡推送记录';

-- ----------------------------
-- Records of flexible_staff_card_notify_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for flexible_staff_card_order_notify_record
-- ----------------------------
DROP TABLE IF EXISTS `flexible_staff_card_order_notify_record`;
CREATE TABLE `flexible_staff_card_order_notify_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `import_biz_no` varchar(64) NOT NULL COMMENT '第三方订单号',
  `flexible_staff_card_order_id` bigint(20) NOT NULL COMMENT '订单id',
  `status` int(20) NOT NULL COMMENT '通知状态',
  `end_time` datetime DEFAULT NULL COMMENT '通知处理完成等最终状态时间',
  `notify_url` varchar(255) DEFAULT NULL COMMENT '回调地址',
  `notify_count` int(20) NOT NULL COMMENT '通知次数 8次（第8次通知完直接status跟新为死信通知人工处理）',
  `next_notify_time` datetime NOT NULL COMMENT '下次通知时间 0m 2m,10m,10m,1h,2h,6h,15h',
  `notify_content` text NOT NULL COMMENT '通知的json字符串',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `status_idx` (`status`),
  KEY `import_biz_no_idx` (`import_biz_no`),
  KEY `end_time_idx` (`end_time`),
  KEY `next_notify_time_idx` (`next_notify_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='灵工卡交易记录通知';

-- ----------------------------
-- Records of flexible_staff_card_order_notify_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for frozen_user_log
-- ----------------------------
DROP TABLE IF EXISTS `frozen_user_log`;
CREATE TABLE `frozen_user_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `frozen_time` datetime NOT NULL COMMENT '冻结时间',
  `frozen_reason` varchar(32) NOT NULL COMMENT '冻结原因',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='冻结用户记录';

-- ----------------------------
-- Records of frozen_user_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for invoice
-- ----------------------------
DROP TABLE IF EXISTS `invoice`;
CREATE TABLE `invoice` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `invoice_title_id` bigint(20) NOT NULL COMMENT '发票抬头表号',
  `delivery_address_id` bigint(20) NOT NULL COMMENT '邮寄地址表号',
  `invoice_title_type` varchar(128) DEFAULT NULL COMMENT '发票抬头类型',
  `invoice_type` int(20) DEFAULT NULL COMMENT '发票类型',
  `invoice_title` varchar(128) NOT NULL COMMENT '发票抬头',
  `tax_id_number` varchar(128) NOT NULL COMMENT '纳税人识别号',
  `accounts_bank` varchar(128) NOT NULL COMMENT '基本开户银行',
  `account_no` varchar(128) NOT NULL COMMENT '基本开户账户',
  `registered_address` varchar(128) NOT NULL COMMENT '企业注册地址',
  `registered_phone` varchar(128) NOT NULL COMMENT '企业注册电话',
  `recipient_name` varchar(128) NOT NULL COMMENT '收件人姓名',
  `province` varchar(128) NOT NULL COMMENT '省',
  `city` varchar(128) NOT NULL COMMENT '市',
  `district` varchar(128) NOT NULL COMMENT '区',
  `detailed_address` varchar(128) NOT NULL COMMENT '详细地址',
  `contacts_phone` varchar(64) NOT NULL COMMENT '联系人手机号',
  `delivery_address_type` int(20) NOT NULL COMMENT '默认地址/非默认地址',
  `charge_record_ids` longtext COMMENT '充值记录id集合',
  `invoice_status` varchar(16) DEFAULT NULL COMMENT '发票状态',
  `invoice_number` varchar(16) DEFAULT NULL COMMENT '发票号码',
  `express_number` varchar(255) DEFAULT NULL COMMENT '快递单号',
  `invoice_url` varchar(255) DEFAULT NULL COMMENT '电子发票链接',
  `invoice_page` varchar(255) DEFAULT NULL COMMENT '电子发票图片',
  `invoice_material` int(20) NOT NULL COMMENT '发票介质',
  `invoice_amount` decimal(19,2) NOT NULL COMMENT '开票金额',
  `dealing_time` datetime DEFAULT NULL COMMENT '已开票时间',
  `mailed_time` datetime DEFAULT NULL COMMENT '已邮寄时间',
  `fail_time` datetime DEFAULT NULL COMMENT '失败时间',
  `fail_message` varchar(128) DEFAULT NULL COMMENT '失败信息',
  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id_idx` (`user_id`),
  KEY `invoice_title_id_idx` (`invoice_title_id`),
  KEY `delivery_address_id_idx` (`delivery_address_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of invoice
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for invoice_title
-- ----------------------------
DROP TABLE IF EXISTS `invoice_title`;
CREATE TABLE `invoice_title` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `invoice_title_type` varchar(128) DEFAULT NULL COMMENT '发票抬头类型',
  `invoice_type` int(20) DEFAULT NULL COMMENT '发票类型',
  `invoice_title` varchar(128) DEFAULT NULL COMMENT '发票抬头',
  `tax_id_number` varchar(128) DEFAULT NULL COMMENT '纳税人识别号',
  `accounts_bank` varchar(128) DEFAULT NULL COMMENT '基本开户银行',
  `account_no` varchar(128) DEFAULT NULL COMMENT '基本开户账户',
  `registered_address` varchar(128) DEFAULT NULL COMMENT '企业注册地址',
  `registered_phone` varchar(128) DEFAULT NULL COMMENT '企业注册电话',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `user_id_idx` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发票抬头表';

-- ----------------------------
-- Records of invoice_title
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for login_log
-- ----------------------------
DROP TABLE IF EXISTS `login_log`;
CREATE TABLE `login_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `mobile` varchar(16) NOT NULL COMMENT '手机号',
  `login_time` datetime NOT NULL COMMENT '登录时间',
  `login_client` varchar(32) DEFAULT NULL COMMENT '登录端',
  `last_login_ip` varchar(32) DEFAULT NULL COMMENT '登录ip',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=124 DEFAULT CHARSET=utf8 COMMENT='登录日志';

-- ----------------------------
-- Records of login_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for menu
-- ----------------------------
DROP TABLE IF EXISTS `menu`;
CREATE TABLE `menu` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) NOT NULL COMMENT '菜单名',
  `op` varchar(128) NOT NULL COMMENT '操作名（只有按钮需要）',
  `permissions` varchar(255) DEFAULT NULL COMMENT '权限集合 逗号分隔',
  `level` int(20) DEFAULT NULL COMMENT '层级 0开始',
  `hidden` int(20) DEFAULT NULL COMMENT '是否隐藏',
  `sort` bigint(20) NOT NULL COMMENT '排序',
  `path` varchar(128) NOT NULL COMMENT '路径',
  `component` varchar(128) DEFAULT NULL COMMENT '组件',
  `icon` varchar(128) NOT NULL COMMENT '图标',
  `pid` bigint(20) NOT NULL COMMENT '父节点',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=154 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of menu
-- ----------------------------
BEGIN;
INSERT INTO `menu` VALUES (1, '系统管理', '', '', 0, 0, 100, 'system', '', 'system', 0, '2019-09-18 00:00:00', '2024-01-15 16:09:57');
INSERT INTO `menu` VALUES (2, '角色管理', '', 'role::search', 1, 0, 2, 'role', 'business/role', '', 1, '2019-11-11 10:00:00', '2019-11-11 10:00:00');
INSERT INTO `menu` VALUES (3, '用户管理', '', 'admin-user::search,role::list', 1, 0, 1, 'adminUser', 'business/adminUser', '', 1, '2019-09-20 00:00:00', '2019-09-20 00:00:00');
INSERT INTO `menu` VALUES (4, '创建用户', 'admin-user::add', 'admin-user::add', 2, 0, 0, '', NULL, '', 3, '2019-11-12 10:00:00', '2019-11-12 10:00:00');
INSERT INTO `menu` VALUES (5, '分配角色', 'role:save-roles', 'role:save-roles', 2, 0, 0, '', NULL, '', 3, '2019-11-12 10:00:00', '2019-11-12 10:00:00');
INSERT INTO `menu` VALUES (6, '创建角色', 'role::add', 'role::add', 2, 0, 0, '', NULL, '', 2, '2019-11-12 10:00:00', '2019-11-12 10:00:00');
INSERT INTO `menu` VALUES (7, '分配菜单', 'menu::save-role-menu', 'menu::save-role-menu', 2, 0, 0, '', NULL, '', 2, '2019-11-12 10:00:00', '2019-11-12 10:00:00');
INSERT INTO `menu` VALUES (8, '商户管理', '', '', 0, 0, 2, 'userManage', '', 'system', 0, '2019-08-08 00:00:00', '2024-01-12 19:44:34');
INSERT INTO `menu` VALUES (9, '正常商户信息', '', 'user::search', 1, 0, 21, 'user', 'business/user', '', 8, '2019-08-08 00:00:00', '2024-03-14 21:16:25');
INSERT INTO `menu` VALUES (10, '商户注册', 'user::register', 'user::register', 2, 0, 1, '', '', '', 9, '2019-08-08 00:00:00', '2022-03-28 17:20:37');
INSERT INTO `menu` VALUES (11, '设置服务费', 'user::update-service-unit-price', 'user::update-service-unit-price', 2, 0, 1, '', '', '', 9, '2019-08-08 00:00:00', '2019-08-08 00:00:00');
INSERT INTO `menu` VALUES (12, '修改信息', 'user::update-user-info', 'user::update-user-info', 2, 0, 1, '', '', '', 9, '2019-08-08 00:00:00', '2019-08-08 00:00:00');
INSERT INTO `menu` VALUES (13, '开放充值页面', 'user::update-open-charge', 'user::update-open-charge', 2, 0, 1, '', '', '', 9, '2019-08-08 00:00:00', '2019-08-08 00:00:00');
INSERT INTO `menu` VALUES (14, '手工充值', 'charge-record::charge-by-admin', 'charge-record::charge-by-admin', 2, 0, 1, '', '', '', 9, '2019-08-08 00:00:00', '2019-08-08 00:00:00');
INSERT INTO `menu` VALUES (15, '创建接口秘钥', 'user::create-appkey', 'user::create-appkey', 2, 0, 1, '', '', '', 9, '2019-08-08 00:00:00', '2019-08-08 00:00:00');
INSERT INTO `menu` VALUES (16, '修改用户状态', 'user::update-user-security-status', 'user::update-user-security-status', 2, 0, 1, '', '', '', 9, '2019-08-08 00:00:00', '2019-08-08 00:00:00');
INSERT INTO `menu` VALUES (17, '合伙人管理', '', '', 0, 0, 1, 'partnerManage', '', 'system', 0, '2019-08-08 00:00:00', '2019-08-08 00:00:00');
INSERT INTO `menu` VALUES (18, '一级合伙人信息', '', 'partner::search', 1, 0, 1, 'partner', 'business/partner', '', 17, '2019-08-08 00:00:00', '2024-03-06 16:32:21');
INSERT INTO `menu` VALUES (19, '合伙人注册', 'partner::register', 'partner::register', 2, 0, 1, '', '', '', 18, '2019-08-08 00:00:00', '2021-11-03 16:41:56');
INSERT INTO `menu` VALUES (20, '设置合伙人分佣', 'partner::update-benefit', 'partner::update-benefit', 2, 0, 1, '', '', '', 18, '2019-08-08 00:00:00', '2021-11-03 16:42:05');
INSERT INTO `menu` VALUES (21, '修改合伙人信息', 'partner::update-partner-info', 'partner::update-partner-info', 2, 0, 1, '', '', '', 18, '2019-08-08 00:00:00', '2021-11-03 16:42:10');
INSERT INTO `menu` VALUES (22, '修改合伙人状态', 'partner::update-partner-security-status', 'partner::update-partner-security-status', 2, 0, 1, '', '', '', 18, '2019-08-08 00:00:00', '2021-11-03 16:42:22');
INSERT INTO `menu` VALUES (23, '服务费管理', '', '', 0, 0, 65, 'chargeCenter', '', 'system', 0, '2019-08-08 00:00:00', '2024-01-18 10:49:08');
INSERT INTO `menu` VALUES (24, '充值记录', '', 'charge-record::search', 1, 0, 1, 'chargeRecord', 'business/chargeRecord', '', 23, '2019-08-08 00:00:00', '2019-08-08 00:00:00');
INSERT INTO `menu` VALUES (25, '批量转账管理', '', '', 0, 0, 4, 'payTransManage', '', 'system', 0, '2019-08-08 00:00:00', '2024-01-18 10:05:23');
INSERT INTO `menu` VALUES (26, '有密转账记录', '', 'pay-trans-batch::search', 1, 0, 3, 'payTransBatch', 'business/payTransBatch', '', 25, '2019-08-08 00:00:00', '2024-01-23 13:20:50');
INSERT INTO `menu` VALUES (27, '有密每日统计', '', 'partner-settle-record::search', 1, 1, 20, 'partnerSettleRecord', 'business/partnerSettleRecord', '', 17, '2019-08-08 00:00:00', '2024-03-06 16:31:53');
INSERT INTO `menu` VALUES (28, '有密结算记录', '', 'partner-settle-log::search', 1, 1, 30, 'partnerSettleLog', 'business/partnerSettleLog', '', 17, '2019-08-08 00:00:00', '2024-03-06 16:31:44');
INSERT INTO `menu` VALUES (29, '收益提现记录', '', 'partner-withdraw-record::search', 1, 0, 60, 'partnerWithdrawRecord', 'business/partnerWithdrawRecord', '', 17, '2019-08-08 00:00:00', '2024-03-06 16:31:21');
INSERT INTO `menu` VALUES (30, '收益批量提现', '', 'partner-withdraw-record-batch::search', 1, 0, 70, 'partnerWithdrawRecordBatch', 'business/partnerWithdrawRecordBatch', '', 17, '2019-08-08 00:00:00', '2024-03-06 16:31:12');
INSERT INTO `menu` VALUES (31, '用户转账统计', '', '', 0, 0, 60, 'userStatistics', '', 'system', 0, '2019-08-08 00:00:00', '2024-01-18 10:48:57');
INSERT INTO `menu` VALUES (32, '批量有密日转账', '', 'user-trans-stat::search', 1, 0, 2, 'transferStatistics', 'business/transferStatistics', '', 31, '2019-08-08 00:00:00', '2024-01-15 16:22:50');
INSERT INTO `menu` VALUES (33, '财务中心', '', '', 0, 0, 70, 'billCenter', '', 'system', 0, '2019-08-08 00:00:00', '2024-03-01 16:29:47');
INSERT INTO `menu` VALUES (34, '收益统计', '', NULL, 1, 0, 1, 'companyBillDailyStat', 'business/companyBillDailyStat', '', 33, '2019-08-08 00:00:00', '2024-03-01 16:30:04');
INSERT INTO `menu` VALUES (35, '操作记录', '', 'operation-record::search,operation-record::list-operation-record-module', 1, 0, 3, 'operationLog', 'business/operationLog', '', 1, '2019-08-08 00:00:00', '2019-08-08 00:00:00');
INSERT INTO `menu` VALUES (36, '菜单管理', '', 'menu::list-menu', 1, 0, 3, 'menuManager', 'business/menuManager', '', 1, '2019-08-08 00:00:00', '2020-11-22 15:15:54');
INSERT INTO `menu` VALUES (37, '新增菜单', 'menu::add-menu', 'menu::add-menu', 2, 0, 3, '', '', '', 36, '2019-08-08 00:00:00', '2019-08-08 00:00:00');
INSERT INTO `menu` VALUES (38, '修改菜单', 'menu::update-menu', 'menu::update-menu', 2, 0, 3, '', '', '', 36, '2019-08-08 00:00:00', '2019-08-08 00:00:00');
INSERT INTO `menu` VALUES (39, '删除菜单', 'menu::delete-menu', 'menu::delete-menu', 2, 0, 3, '', '', '', 36, '2019-08-08 00:00:00', '2020-11-22 15:01:17');
INSERT INTO `menu` VALUES (47, '配置管理', '', 'site-config::get', 1, 0, 4, 'siteConfig', 'business/siteConfig', '', 1, '2021-09-01 10:06:22', '2021-09-01 10:06:47');
INSERT INTO `menu` VALUES (48, '新增配置', 'site-config::add', 'site-config::add', 2, 0, 0, '', '', '', 47, '2021-09-01 10:22:58', '2021-09-01 10:26:46');
INSERT INTO `menu` VALUES (49, '跟新配置', 'site-config::update', 'site-config::update', 2, 0, 0, '', '', '', 47, '2021-09-01 10:22:58', '2021-09-01 10:26:46');
INSERT INTO `menu` VALUES (50, '充值体验次数', 'charge-record::charge-trans-batch-by-admin', 'charge-record::charge-trans-batch-by-admin', 2, 0, 0, '', '', '', 9, '2021-09-06 11:55:37', '2021-09-06 11:55:37');
INSERT INTO `menu` VALUES (51, '安全转账记录', '', 'safe-pay-batch::search', 1, 0, 1, 'safePayBatch', 'business/safePayBatch', '', 25, '2021-09-07 11:20:55', '2024-01-23 13:20:39');
INSERT INTO `menu` VALUES (53, '数据看盘', '', 'trans-stat::sum', 1, 1, 11, 'transStat', 'business/transStat', 'system', 31, '2021-10-19 15:52:16', '2024-01-22 20:05:19');
INSERT INTO `menu` VALUES (54, '安全发日转账', '', 'user-safe-pay-trans-stat::search', 1, 0, 0, 'safePayTransStat', 'business/safePayTransStat', '', 31, '2021-11-01 17:23:54', '2024-02-20 10:49:47');
INSERT INTO `menu` VALUES (55, '安全付每日统计', '', 'partner-safe-pay-settle-record::search', 1, 1, 40, 'partnerSafePaySettleRecord', 'business/partnerSafePaySettleRecord', '', 17, '2021-11-03 16:39:09', '2024-03-06 16:31:36');
INSERT INTO `menu` VALUES (56, '安全付结算记录', '', 'partner-safe-pay-settle-log::search', 1, 1, 50, 'partnerSafePaySettleLog', 'business/partnerSafePaySettleLog', '', 17, '2021-11-03 16:43:19', '2024-03-06 16:31:29');
INSERT INTO `menu` VALUES (57, '银行转账', 'partner-withdraw-record-batch::ensure-trans', 'partner-withdraw-record-batch::ensure-trans', 2, 0, 0, '', '', '', 30, '2021-11-22 18:25:24', '2021-11-22 18:25:24');
INSERT INTO `menu` VALUES (58, '服务费提现', '', 'user-withdraw-record::search', 1, 0, 2, 'userwithdraw', 'business/userwithdraw', '', 23, '2021-12-13 19:14:15', '2024-01-15 16:13:52');
INSERT INTO `menu` VALUES (59, '开放鱼塘付接口', 'user::update-open-auto-pay', 'user::update-open-auto-pay', 2, 0, 0, '', '', '', 9, '2022-03-10 20:50:02', '2022-03-10 20:50:02');
INSERT INTO `menu` VALUES (61, '业务监控', '', '', 0, 0, 90, '', '', 'system', 0, '2022-03-25 17:31:48', '2024-01-18 10:48:00');
INSERT INTO `menu` VALUES (62, '有密转账回调记录', '', NULL, 1, 0, 0, 'chargeNotifyRecord', 'business/chargeNotifyRecord', '', 61, '2022-03-25 17:39:13', '2024-01-15 16:15:28');
INSERT INTO `menu` VALUES (63, '安全发转账回调记录', '', 'safe-pay-batch-notify-record::search', 1, 0, 0, 'safePayBatchNotifyRecord', 'business/safePayBatchNotifyRecord', '', 61, '2022-08-05 16:03:08', '2024-02-20 11:33:16');
INSERT INTO `menu` VALUES (64, '审核中心', '', '', 0, 0, 80, 'auditCenter', '', 'system', 0, '2022-09-29 10:45:27', '2024-01-18 10:48:11');
INSERT INTO `menu` VALUES (65, '安全发企业认证', '', NULL, 1, 0, 1, 'safePayenterpriseAuthentication', 'business/safePayenterpriseAuthentication', '', 64, '2022-09-29 10:54:32', '2024-02-20 11:23:56');
INSERT INTO `menu` VALUES (67, '发票管理', '', NULL, 1, 0, 22, 'invoiceAdministration', 'business/invoiceAdministration', '', 8, '2022-10-17 13:53:49', '2022-10-17 13:54:04');
INSERT INTO `menu` VALUES (68, '账号企业认证', '', NULL, 1, 0, 2, 'userBusinessAuthentication', 'business/userBusinessAuthentication', '', 64, '2022-11-09 11:13:21', '2022-11-09 11:13:29');
INSERT INTO `menu` VALUES (70, '发票详情', '', NULL, 1, 1, 23, 'invoiceDetails', 'business/invoiceDetails', '', 8, '2022-11-11 15:57:55', '2024-01-18 20:12:32');
INSERT INTO `menu` VALUES (72, '安全发收费统计', '', NULL, 1, 1, 1, 'safePayTransStat2', 'business/safePayTransStat2', '', 31, '2023-04-25 12:01:06', '2024-01-18 20:16:37');
INSERT INTO `menu` VALUES (73, '安全发月转账', '', NULL, 1, 0, 0, 'safePayTransMonthStat', 'business/safePayTransMonthStat', '', 31, '2023-04-25 13:38:06', '2024-02-20 10:49:55');
INSERT INTO `menu` VALUES (74, '安全付结算工具', '', NULL, 1, 1, 10, 'safePayBill', 'business/safePayBill', '', 31, '2023-06-01 17:32:08', '2024-01-18 20:16:20');
INSERT INTO `menu` VALUES (75, '开启安全发签约新方式', 'user::update-open-safe-pay-new-sign-method', 'user::update-open-safe-pay-new-sign-method', 2, 0, 2, '', '', '', 9, '2023-06-07 12:41:58', '2023-06-07 12:41:58');
INSERT INTO `menu` VALUES (76, '注册报备', 'user-registration::submit', 'user-registration::submit', 2, 0, 1, '', '', '', 9, '2023-07-27 17:24:50', '2023-07-27 17:24:50');
INSERT INTO `menu` VALUES (77, '服务费充值回调', '', NULL, 1, 1, 0, 'chargeRecordNotifyRecord', 'business/chargeRecordNotifyRecord', '', 61, '2023-08-15 13:46:14', '2024-01-29 14:50:39');
INSERT INTO `menu` VALUES (78, '系统配置', '', NULL, 1, 0, 0, 'commonSysConfig', 'business/commonSysConfig', '', 1, '2023-12-29 16:31:29', '2023-12-29 16:31:29');
INSERT INTO `menu` VALUES (79, '合伙人换绑', 'user::update-partner', 'user::update-partner', 2, 0, 2, '', '', '', 9, '2024-01-08 13:46:10', '2024-01-08 13:46:42');
INSERT INTO `menu` VALUES (80, '开户审核', '', 'partner-user-filings::search', 1, 0, 0, 'partnerUserFilings', 'business/partnerUserFilings', '', 64, '2024-01-08 13:50:14', '2024-01-08 13:50:14');
INSERT INTO `menu` VALUES (81, '通过', 'partner-user-filings::audit-success', 'partner-user-filings::audit-success', 2, 0, 0, '', '', '', 80, '2024-01-08 15:04:15', '2024-01-08 15:04:15');
INSERT INTO `menu` VALUES (82, '拒绝', 'partner-user-filings::audit-fail', 'partner-user-filings::audit-fail', 2, 0, 0, '', '', '', 80, '2024-01-08 15:04:34', '2024-01-08 15:04:34');
INSERT INTO `menu` VALUES (84, '批量有密月转账', '', NULL, 1, 0, 2, 'transMonthferStatistics', 'business/transMonthferStatistics', '', 31, '2024-01-18 13:58:05', '2024-01-18 13:58:32');
INSERT INTO `menu` VALUES (85, '安全单笔明细', '', 'safe-pay-order::search', 1, 0, 0, 'safePayOrder', 'business/safePayOrder', '', 25, '2024-01-22 22:17:24', '2024-01-23 13:21:41');
INSERT INTO `menu` VALUES (86, '有密单笔明细', '', 'payTrans::search', 1, 0, 2, 'payTrans', 'business/payTrans', '', 25, '2024-01-23 12:40:56', '2024-01-23 13:21:48');
INSERT INTO `menu` VALUES (87, '备付金管理', '', '', 0, 0, 66, 'payerShowCenter', '', 'system', 0, '2024-01-24 14:21:27', '2024-01-29 12:05:14');
INSERT INTO `menu` VALUES (88, '备付金充值记录', '', 'safe-pay-book-account-order::search', 1, 0, 0, 'safePayChargeOrder', 'business/safePayChargeOrder', '', 87, '2024-01-24 14:23:47', '2024-01-24 14:59:38');
INSERT INTO `menu` VALUES (89, '备付金汇款充值记录', '', 'safe-pay-book-account-large-deposit-charge-order::search', 1, 0, 0, 'safePayLargeDepositChargeOrder', 'business/safePayLargeDepositChargeOrder', '', 87, '2024-01-24 21:32:33', '2024-01-24 21:32:33');
INSERT INTO `menu` VALUES (90, '服务费明细', '', 'account-log::search', 1, 0, 3, 'accountLog', 'business/accountLog', '', 23, '2024-01-25 13:41:22', '2024-01-25 13:41:22');
INSERT INTO `menu` VALUES (91, '内部结算', '', '', 0, 0, 67, 'InternalSettlement', '', 'system', 0, '2024-01-25 14:17:39', '2024-01-29 12:05:25');
INSERT INTO `menu` VALUES (92, '员工结算', '', 'partner_insider_settle_log::search', 1, 0, 0, 'staffSettlementTools', 'business/staffSettlementTools', '', 91, '2024-01-25 14:19:07', '2024-01-25 21:49:06');
INSERT INTO `menu` VALUES (93, '删除用户', 'admin-user::remove-role', 'admin-user::remove-role', 2, 0, 0, '', '', '', 3, '2024-02-01 16:24:46', '2024-02-01 16:24:46');
INSERT INTO `menu` VALUES (94, '重置密码', 'admin-user::resetting-password', 'admin-user::resetting-password', 2, 0, 0, '', '', '', 3, '2024-02-01 16:25:14', '2024-02-01 16:25:14');
INSERT INTO `menu` VALUES (95, '查看秘钥', 'user::select-appkey', 'user::select-appkey', 2, 0, 0, '', '', '', 9, '2024-02-01 17:36:07', '2024-02-01 17:36:07');
INSERT INTO `menu` VALUES (96, '提现', 'partner-withdraw-record-batch::create', 'partner-withdraw-record-batch::create', 2, 0, 0, '', '', '', 18, '2024-02-02 16:08:54', '2024-02-02 16:08:54');
INSERT INTO `menu` VALUES (97, '修改信息', 'safe-pay-business-auth-audit-record::update-info', 'safe-pay-business-auth-audit-record::update-info', 2, 0, 0, '', '', '', 65, '2024-02-02 19:17:39', '2024-02-02 19:17:39');
INSERT INTO `menu` VALUES (98, '验证码管理', '', 'check-code::search', 1, 0, 0, 'checkCode', 'business/checkCode', '', 61, '2024-02-05 17:51:10', '2024-02-05 17:51:10');
INSERT INTO `menu` VALUES (99, '一级合伙人收益统计', '', 'partner-combination-settle-record::agg-search', 1, 0, 10, 'partnerCombinationSettleRecord', 'business/partnerCombinationSettleRecord', '', 17, '2024-02-05 21:31:29', '2024-03-06 16:42:48');
INSERT INTO `menu` VALUES (100, '修改手机号', 'user::update-mobile', 'user::update-mobile', 2, 0, 0, '', '', '', 9, '2024-02-20 13:58:10', '2024-02-20 13:58:10');
INSERT INTO `menu` VALUES (101, '开放安全发接口', 'user::update-open-safe-pay', 'user::update-open-safe-pay', 2, 0, 0, '', '', '', 9, '2024-02-20 14:14:23', '2024-02-20 14:14:23');
INSERT INTO `menu` VALUES (102, '开放安全发到卡接口', 'user::update-open-safe-pay-bank', 'user::update-open-safe-pay-bank', 2, 0, 0, '', '', '', 9, '2024-02-20 14:19:36', '2024-02-20 14:19:36');
INSERT INTO `menu` VALUES (103, '开放开具发票接口', 'user::update-open-invoice', 'user::update-open-invoice', 2, 0, 0, '', '', '', 9, '2024-02-20 14:25:41', '2024-02-20 14:25:41');
INSERT INTO `menu` VALUES (104, '作废', 'charge-record::cancel-charge-record', 'charge-record::cancel-charge-record', 2, 0, 0, '', '', '', 24, '2024-02-20 14:33:39', '2024-02-20 14:33:39');
INSERT INTO `menu` VALUES (105, '转账', 'user-withdraw-record::trans', 'user-withdraw-record::trans', 2, 0, 0, '', '', '', 58, '2024-02-20 14:37:58', '2024-02-20 14:37:58');
INSERT INTO `menu` VALUES (106, '关闭', 'user-withdraw-record::close', 'user-withdraw-record::close', 2, 0, 0, '', '', '', 58, '2024-02-20 14:42:17', '2024-02-20 14:42:17');
INSERT INTO `menu` VALUES (107, '审核成功', 'safe-pay-business-auth-audit-record::audit-success', 'safe-pay-business-auth-audit-record::audit-success', 2, 0, 0, '', '', '', 65, '2024-02-20 15:01:19', '2024-02-20 15:01:19');
INSERT INTO `menu` VALUES (108, '审核失败', 'safe-pay-business-auth-audit-record::audit-fail', 'safe-pay-business-auth-audit-record::audit-fail', 2, 0, 0, '', '', '', 65, '2024-02-20 15:01:49', '2024-02-20 15:01:49');
INSERT INTO `menu` VALUES (109, '审核成功', 'user-business-auth::audit-success', 'user-business-auth::audit-success', 2, 0, 0, '', '', '', 68, '2024-02-20 15:04:53', '2024-02-20 15:04:53');
INSERT INTO `menu` VALUES (110, '审核失败', 'user-business-auth::audit-fail', 'user-business-auth::audit-fail', 2, 0, 0, '', '', '', 68, '2024-02-20 15:05:14', '2024-02-20 15:05:14');
INSERT INTO `menu` VALUES (111, '新增', 'common-sys-config::save', 'common-sys-config::save', 2, 0, 0, '', '', '', 78, '2024-02-20 15:17:39', '2024-02-20 15:17:39');
INSERT INTO `menu` VALUES (112, '重试回调', 'safe-pay-batch-notify-record::initiate', 'safe-pay-batch-notify-record::initiate', 2, 0, 0, '', '', '', 63, '2024-02-20 15:38:32', '2024-02-20 15:38:32');
INSERT INTO `menu` VALUES (113, '重试回调', 'charge-notify-record::initiate', 'charge-notify-record::initiate', 2, 0, 0, '', '', '', 62, '2024-02-20 15:41:31', '2024-02-20 15:41:31');
INSERT INTO `menu` VALUES (114, '修改配置', 'common-sys-config::update', 'common-sys-config::update', 2, 0, 0, '', '', '', 78, '2024-02-20 17:20:28', '2024-02-20 17:20:28');
INSERT INTO `menu` VALUES (115, '接口监控', '', 'api-monitor::search', 1, 0, 0, 'apiMonitor', 'business/apiMonitor', '', 61, '2024-02-22 13:59:32', '2024-02-23 17:57:47');
INSERT INTO `menu` VALUES (116, '重置密码', 'partner::reset-partner-password', 'partner::reset-partner-password', 2, 0, 0, '', '', '', 18, '2024-02-23 17:57:10', '2024-02-23 17:57:10');
INSERT INTO `menu` VALUES (117, '商户留存查询', '', 'user-account-money-left-stat::search', 1, 0, 2, 'merchantPreserve', 'business/merchantPreserve', '', 33, '2024-03-01 16:40:30', '2024-03-04 20:26:37');
INSERT INTO `menu` VALUES (119, '多商户管理', '', 'operation-user::search', 1, 0, 24, 'operatorUser', 'business/operatorUser', '', 8, '2024-03-02 18:04:46', '2024-03-02 18:05:03');
INSERT INTO `menu` VALUES (120, '冻结', 'operation-user::update-status', 'operation-user::update-status', 2, 0, 0, '', '', '', 119, '2024-03-02 21:41:05', '2024-03-02 21:41:05');
INSERT INTO `menu` VALUES (121, '重置登录密码', 'operation-user::reset-password', 'operation-user::reset-password', 2, 0, 0, '', '', '', 119, '2024-03-02 21:41:51', '2024-03-02 21:41:51');
INSERT INTO `menu` VALUES (122, '查看', 'operation-user-bind-log::search', 'operation-user-bind-log::search', 2, 0, 0, '', '', '', 119, '2024-03-02 21:44:18', '2024-03-02 21:44:18');
INSERT INTO `menu` VALUES (125, '首页', 'dashboard::index', 'dashboard::index', 1, 0, 0, 'dashboard/index', 'business/dashboard/index', '', 0, '2024-03-04 11:01:45', '2024-03-04 11:01:45');
INSERT INTO `menu` VALUES (126, '二级合伙人信息', '', 'partner::search', 1, 0, 2, 'twoLevelPartner', 'business/twoLevelPartner', '', 17, '2024-03-04 15:02:52', '2024-03-06 16:43:10');
INSERT INTO `menu` VALUES (127, '导出', 'partner-combination-settle-record::export', 'partner-combination-settle-record::export', 2, 0, 0, '', '', '', 99, '2024-03-05 10:00:17', '2024-03-05 10:00:17');
INSERT INTO `menu` VALUES (128, '注册', 'partner::registe', 'partner::registe', 2, 0, 0, '', '', '', 126, '2024-03-06 16:33:04', '2024-03-06 16:33:04');
INSERT INTO `menu` VALUES (129, '密码重置', 'partner::reset-partner-password', 'partner::reset-partner-password', 2, 0, 0, '', '', '', 126, '2024-03-06 16:34:06', '2024-03-06 16:34:06');
INSERT INTO `menu` VALUES (130, '设置分佣', 'partner::update-level2-benefit', 'partner::update-level2-benefit', 2, 0, 0, '', '', '', 126, '2024-03-06 16:34:29', '2024-03-06 16:34:29');
INSERT INTO `menu` VALUES (131, '管理', 'partner::update-partner-info', 'partner::update-partner-info', 2, 0, 0, '', '', '', 126, '2024-03-06 16:34:47', '2024-03-06 16:34:47');
INSERT INTO `menu` VALUES (132, '冻结', 'partner::update-partner-security-status', 'partner::update-partner-security-status', 2, 0, 0, '', '', '', 126, '2024-03-06 16:35:05', '2024-03-06 16:35:05');
INSERT INTO `menu` VALUES (135, '冻结商户信息', '', 'user::search', 1, 0, 21, 'frozenUser', 'business/frozenUser', '', 8, '2024-03-14 21:17:25', '2024-03-14 21:17:45');
INSERT INTO `menu` VALUES (136, '商户冻结记录', '', 'frozen-user-log::search', 1, 0, 0, 'frozenUserLog', 'business/frozenUserLog', '', 61, '2024-03-14 21:44:24', '2024-03-14 21:44:24');
INSERT INTO `menu` VALUES (137, '记账本开通', '', 'safe-pay-book-pre-apply-record:;search', 1, 0, 0, 'safePayBookPreApplyRecord', 'business/safePayBookPreApplyRecord', '', 8, '2024-03-15 16:59:33', '2024-03-15 17:38:27');
INSERT INTO `menu` VALUES (138, '记账本开通', 'safe-pay-book-pre-apply-record::apply', 'safe-pay-book-pre-apply-record::apply', 2, 0, 0, '', '', '', 137, '2024-03-15 21:54:03', '2024-03-15 21:54:03');
INSERT INTO `menu` VALUES (139, '挂载', 'safe-pay-book-pre-apply-record::mount', 'safe-pay-book-pre-apply-record::mount', 2, 0, 0, '', '', '', 137, '2024-03-15 21:54:41', '2024-03-15 21:54:41');
INSERT INTO `menu` VALUES (140, '开放平台', '', '', 0, 0, 85, 'openPlatform', '', 'system', 0, '2024-03-19 16:00:47', '2024-03-19 16:00:47');
INSERT INTO `menu` VALUES (141, '应用管理', '', 'open-app::search', 1, 0, 0, 'openApp', 'business/openApp', '', 8, '2024-03-19 16:02:28', '2024-03-19 17:40:51');
INSERT INTO `menu` VALUES (142, '创建应用', 'open-app::save', 'open-app::save', 2, 0, 0, '', '', '', 9, '2024-03-19 17:38:57', '2024-03-19 17:38:57');
INSERT INTO `menu` VALUES (143, '修改应用', 'open-app::update', 'open-app::update', 2, 0, 0, '', '', '', 141, '2024-03-19 17:39:50', '2024-03-19 17:39:50');
INSERT INTO `menu` VALUES (144, '查看平台公钥 ', 'open-app::select-appPublickey', 'open-app::select-appPublickey', 2, 0, 0, '', '', '', 141, '2024-03-19 17:40:25', '2024-03-20 12:11:50');
INSERT INTO `menu` VALUES (145, '修改ip白名单', 'open-app::update-whiteIps', 'open-app::update-whiteIps', 2, 0, 0, '', '', '', 141, '2024-03-20 12:11:22', '2024-03-20 12:11:22');
INSERT INTO `menu` VALUES (146, '应用上线', 'open-app::open', 'open-app::open', 2, 0, 0, '', '', '', 141, '2024-03-21 10:47:05', '2024-03-21 10:47:05');
INSERT INTO `menu` VALUES (147, '应用下线', 'open-app::closed', 'open-app::closed', 2, 0, 0, '', '', '', 141, '2024-03-21 10:47:21', '2024-03-21 10:47:21');
INSERT INTO `menu` VALUES (149, '重置密码', 'user::reset-password', 'user::reset-password', 2, 0, 0, '', '', '', 9, '2024-04-07 10:10:16', '2024-04-07 10:10:16');
INSERT INTO `menu` VALUES (150, '显示余额', 'partner::show-account-info', 'partner::show-account-info', 2, 0, 0, '', '', '', 18, '2024-04-09 14:50:43', '2024-04-09 14:51:06');
INSERT INTO `menu` VALUES (151, '显示分佣', 'partner::show-benefit-info', 'partner::show-benefit-info', 2, 0, 0, '', '', '', 18, '2024-04-09 14:51:48', '2024-04-09 14:51:48');
INSERT INTO `menu` VALUES (152, '显示分佣', 'level2partner::show-benefit-info', 'level2partner::show-benefit-info', 2, 0, 0, '', '', '', 126, '2024-04-09 14:52:29', '2024-04-09 14:52:29');
INSERT INTO `menu` VALUES (153, '显示余额', 'level2partner::show-account-info', 'level2partner::show-account-info', 2, 0, 0, '', '', '', 126, '2024-04-09 14:52:42', '2024-04-09 14:52:42');
COMMIT;

-- ----------------------------
-- Table structure for notification
-- ----------------------------
DROP TABLE IF EXISTS `notification`;
CREATE TABLE `notification` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `title` varchar(32) NOT NULL COMMENT '标题',
  `summary` varchar(255) NOT NULL COMMENT '摘要',
  `content` text NOT NULL COMMENT '内容',
  `status` varchar(16) NOT NULL COMMENT '状态',
  `module` varchar(16) NOT NULL COMMENT '模块',
  `start_time` datetime NOT NULL COMMENT '开始时间',
  `end_time` datetime NOT NULL COMMENT '结束时间',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `end_time_idx` (`end_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统通知表';

-- ----------------------------
-- Records of notification
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for open_alipay_auth_token
-- ----------------------------
DROP TABLE IF EXISTS `open_alipay_auth_token`;
CREATE TABLE `open_alipay_auth_token` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `appkey` varchar(128) NOT NULL COMMENT 'appkey',
  `isv_biz_id` varchar(255) NOT NULL COMMENT '签约事务号',
  `out_biz_id` varchar(128) NOT NULL COMMENT '外部事务号',
  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
  `status` int(20) NOT NULL COMMENT '签约状态 0未签约 1已签约',
  `alipay_user_id` varchar(128) DEFAULT NULL COMMENT '支付宝官方用户id',
  `alipay_nick_name` varchar(128) DEFAULT NULL COMMENT '支付宝账号',
  `auth_token` varchar(128) DEFAULT NULL COMMENT 'auth_token',
  `refresh_token` varchar(128) DEFAULT NULL COMMENT 'refresh_token',
  `expires_in` datetime DEFAULT NULL COMMENT 'auth_token过期时间',
  `re_expires_in` datetime DEFAULT NULL COMMENT 'refresh_token过期时间',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `isv_biz_id_idx` (`isv_biz_id`),
  UNIQUE KEY `appkey_out_biz_id_idx` (`appkey`,`out_biz_id`),
  KEY `appkey_idx` (`appkey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='外部应用支付宝账号签约';

-- ----------------------------
-- Records of open_alipay_auth_token
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for open_api_app
-- ----------------------------
DROP TABLE IF EXISTS `open_api_app`;
CREATE TABLE `open_api_app` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) NOT NULL COMMENT '应用名',
  `appkey` varchar(128) NOT NULL COMMENT 'appkey',
  `secret` varchar(128) NOT NULL COMMENT 'secret',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `appkey_idx` (`appkey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='开发api应用';

-- ----------------------------
-- Records of open_api_app
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for open_app
-- ----------------------------
DROP TABLE IF EXISTS `open_app`;
CREATE TABLE `open_app` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '商户号',
  `status` int(20) NOT NULL COMMENT '应用状态',
  `public_key` varchar(512) DEFAULT NULL COMMENT '平台公钥',
  `private_key` varchar(2048) DEFAULT NULL COMMENT '平台私钥',
  `app_public_key` varchar(512) DEFAULT NULL COMMENT '应用公钥',
  `encrypt_key` varchar(64) DEFAULT NULL COMMENT '请求内容加密 bizContent加密',
  `check_ip` int(20) NOT NULL COMMENT '是否开启白名单效验 默认都是开启 若关闭需要签署安全责任协议',
  `white_ips` varchar(2048) DEFAULT NULL COMMENT '白名单ips',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_idx` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=201800000001 DEFAULT CHARSET=utf8mb4 COMMENT='开放接口应用';

-- ----------------------------
-- Records of open_app
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for open_image
-- ----------------------------
DROP TABLE IF EXISTS `open_image`;
CREATE TABLE `open_image` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '商户号',
  `app_id` bigint(20) NOT NULL COMMENT '应用id',
  `image_id` varchar(64) NOT NULL COMMENT '图片id',
  `image_url` varchar(255) NOT NULL COMMENT '图片链接',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `image_id_idx` (`image_id`),
  KEY `app_id_idx` (`app_id`),
  KEY `user_id_idx` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of open_image
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for operation_record
-- ----------------------------
DROP TABLE IF EXISTS `operation_record`;
CREATE TABLE `operation_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `method_desc` varchar(128) DEFAULT NULL COMMENT '方法操作描述',
  `username` varchar(32) NOT NULL COMMENT '用户名',
  `mobile` varchar(11) NOT NULL COMMENT '用户手机号码',
  `admin_user_id` bigint(20) DEFAULT NULL COMMENT '用户的id 唯一标识符',
  `method_type` varchar(64) DEFAULT NULL COMMENT '接口方法的类型 比如insert对于新增',
  `in_param` text COMMENT '接口方法入参',
  `interface_url` varchar(128) DEFAULT NULL COMMENT '接口路由',
  `module` varchar(64) DEFAULT NULL COMMENT '用户的操作模块',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8 COMMENT='管理员操作记录表';

-- ----------------------------
-- Records of operation_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for operator_user
-- ----------------------------
DROP TABLE IF EXISTS `operator_user`;
CREATE TABLE `operator_user` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `mobile` varchar(16) NOT NULL COMMENT '手机号',
  `password` varchar(128) NOT NULL COMMENT '密码',
  `register_time` datetime NOT NULL COMMENT '注册时间',
  `register_ip` varchar(128) DEFAULT NULL COMMENT '注册时候的ip',
  `last_login_time` datetime DEFAULT NULL COMMENT '上次登录时间',
  `last_login_client` varchar(16) DEFAULT NULL COMMENT '上次的登录来源',
  `last_login_ip` varchar(128) DEFAULT NULL COMMENT '最后一次登陆ip',
  `login_count` bigint(20) DEFAULT NULL COMMENT '累计登陆次数',
  `security_status` int(20) DEFAULT NULL COMMENT '安全状态',
  `security_remark` varchar(32) DEFAULT NULL COMMENT '安全备注',
  `error_count` int(20) NOT NULL COMMENT '密码输入错误的次数',
  `version` bigint(20) DEFAULT NULL,
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `mobile_idx` (`mobile`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='操盘手';

-- ----------------------------
-- Records of operator_user
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for operator_user_bind_log
-- ----------------------------
DROP TABLE IF EXISTS `operator_user_bind_log`;
CREATE TABLE `operator_user_bind_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `type` varchar(128) NOT NULL COMMENT '操作描述',
  `operator_user_id` bigint(20) NOT NULL COMMENT '操盘手id',
  `user_id` bigint(20) NOT NULL COMMENT '商户id',
  `user_name` varchar(128) NOT NULL COMMENT '商户名称',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='操盘手操作记录表';

-- ----------------------------
-- Records of operator_user_bind_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for operator_user_binding
-- ----------------------------
DROP TABLE IF EXISTS `operator_user_binding`;
CREATE TABLE `operator_user_binding` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `operator_user_id` bigint(20) NOT NULL COMMENT '操盘手id',
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_idx` (`user_id`),
  KEY `operator_user_id_idx` (`operator_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='操盘手关联用户表';

-- ----------------------------
-- Records of operator_user_binding
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner
-- ----------------------------
DROP TABLE IF EXISTS `partner`;
CREATE TABLE `partner` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `version` bigint(20) NOT NULL COMMENT '版本号',
  `mobile` varchar(16) NOT NULL COMMENT '注册手机号',
  `password` varchar(128) NOT NULL COMMENT '密码',
  `pay_password` varchar(128) DEFAULT NULL COMMENT '支付密码',
  `level` int(20) NOT NULL COMMENT '合伙人级别 1.一级 2.二级',
  `settle_period` varchar(8) NOT NULL DEFAULT 'month' COMMENT '结算周期',
  `father_partner_id` bigint(20) DEFAULT NULL COMMENT '父合伙人id',
  `wechat_qr_code` varchar(255) DEFAULT NULL COMMENT '网站客服二维码',
  `name` varchar(16) DEFAULT NULL COMMENT '姓名',
  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
  `alipay_name` varchar(16) DEFAULT NULL COMMENT '支付宝实名',
  `alipay_account` varchar(64) DEFAULT NULL COMMENT '支付宝收款账号',
  `auto_withdraw` int(20) DEFAULT NULL COMMENT '是否自动提现 默认1',
  `register_time` datetime NOT NULL COMMENT '注册时间',
  `register_ip` varchar(32) DEFAULT NULL COMMENT '注册ip',
  `last_login_time` datetime DEFAULT NULL COMMENT '上次登录时间',
  `last_login_client` varchar(16) DEFAULT NULL COMMENT '上次登录客户端',
  `last_login_ip` varchar(128) DEFAULT NULL COMMENT '上次登录ip',
  `login_count` bigint(20) DEFAULT NULL COMMENT '总登录次数',
  `security_status` int(20) DEFAULT NULL COMMENT '安全状态',
  `security_remark` varchar(32) DEFAULT NULL COMMENT '安全备注',
  `error_count` int(20) NOT NULL COMMENT '登录出错的次数',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `mobile_idx` (`mobile`)
) ENGINE=InnoDB AUTO_INCREMENT=1000001 DEFAULT CHARSET=utf8 COMMENT='合伙人';

-- ----------------------------
-- Records of partner
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_account
-- ----------------------------
DROP TABLE IF EXISTS `partner_account`;
CREATE TABLE `partner_account` (
  `id` bigint(20) NOT NULL,
  `version` bigint(20) NOT NULL COMMENT '版本号',
  `money_left` bigint(20) NOT NULL COMMENT '剩余金额 分',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='合伙人账户';

-- ----------------------------
-- Records of partner_account
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_account_detail
-- ----------------------------
DROP TABLE IF EXISTS `partner_account_detail`;
CREATE TABLE `partner_account_detail` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `version` bigint(20) NOT NULL COMMENT '版本号',
  `partner_id` bigint(20) NOT NULL COMMENT '合伙人id',
  `related_id` bigint(20) NOT NULL COMMENT '相关业务id',
  `type` varchar(64) NOT NULL COMMENT '业务类型',
  `bill_pay_method` varchar(64) NOT NULL COMMENT '支付方式',
  `pay_status` varchar(64) NOT NULL COMMENT '支付状态',
  `memo` varchar(255) DEFAULT NULL COMMENT '备注',
  `end_time` datetime DEFAULT NULL COMMENT '交易完成时间',
  `account_money` bigint(20) NOT NULL COMMENT '账户变动的金额',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `partner_id_related_id_type_idx` (`partner_id`,`related_id`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='合伙人账户交易明细';

-- ----------------------------
-- Records of partner_account_detail
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_account_log
-- ----------------------------
DROP TABLE IF EXISTS `partner_account_log`;
CREATE TABLE `partner_account_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `partner_id` bigint(20) NOT NULL COMMENT '合伙人id',
  `type` varchar(64) NOT NULL COMMENT '交易类型',
  `account_detail_id` bigint(20) NOT NULL COMMENT '交易id',
  `related_id` bigint(20) NOT NULL COMMENT '关联id',
  `memo` varchar(255) DEFAULT NULL COMMENT '备注',
  `change` bigint(20) NOT NULL COMMENT '改变的金额 分',
  `before_amount` bigint(20) DEFAULT NULL COMMENT '变化前的金额 分',
  `after_amount` bigint(20) DEFAULT NULL COMMENT '变化后的金额 分',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `partner_id_idx` (`partner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='合伙人账户日志';

-- ----------------------------
-- Records of partner_account_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_code
-- ----------------------------
DROP TABLE IF EXISTS `partner_code`;
CREATE TABLE `partner_code` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `version` bigint(20) NOT NULL COMMENT '版本号',
  `partner_id` bigint(20) NOT NULL COMMENT '合伙人id',
  `father_partner_id` bigint(20) DEFAULT NULL COMMENT '父合伙人id',
  `pma` varchar(64) NOT NULL COMMENT '推广码',
  `mode` varchar(64) DEFAULT NULL COMMENT '服务费收费模式',
  `commission_mode` varchar(64) DEFAULT NULL COMMENT '分佣模式',
  `service_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费比例',
  `bank_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '到卡服务费收费比例',
  `benefit_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费分成比例',
  `father_benefit_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费分成比例',
  `father_commission_mode` varchar(64) DEFAULT NULL COMMENT '上级模式',
  `father_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '上级合伙人到户分佣费率',
  `father_bank_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '上级合伙人到卡分佣费率',
  `cost_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费成本价收费比例',
  `safe_pay_bank_cost_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '安全付到卡服务费成本价收费比例',
  `service_unit_price` bigint(20) DEFAULT NULL COMMENT '收费单价 分',
  `benefit` bigint(20) NOT NULL COMMENT '分佣 分',
  `father_benefit` bigint(20) DEFAULT NULL COMMENT '父合伙人分佣 分',
  `user_tag` varchar(16) NOT NULL COMMENT '合伙人id',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `status` int(20) DEFAULT NULL COMMENT '状态 0.失效 1.有效',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `pma_unq_idx` (`pma`),
  KEY `partner_id_idx` (`partner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='合伙人推广码';

-- ----------------------------
-- Records of partner_code
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_combination_settle_record
-- ----------------------------
DROP TABLE IF EXISTS `partner_combination_settle_record`;
CREATE TABLE `partner_combination_settle_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `day` date NOT NULL COMMENT '日期',
  `user_id` bigint(20) NOT NULL COMMENT '商户id',
  `partner_id` bigint(20) NOT NULL COMMENT '合伙人id',
  `month` int(20) NOT NULL COMMENT '月份',
  `year` int(20) NOT NULL COMMENT '年份',
  `type` int(20) NOT NULL COMMENT '业务类型 1.批量有密  2.安全发',
  `settled` int(20) NOT NULL COMMENT '是否已结算',
  `settle_time` datetime DEFAULT NULL COMMENT '结算时间',
  `service_ratio` decimal(19,4) DEFAULT NULL COMMENT '到支付宝服务费收费比例',
  `bank_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '到卡服务费收费比例',
  `commission_mode` varchar(32) DEFAULT NULL COMMENT '分佣模式',
  `benefit_ratio` decimal(19,4) DEFAULT NULL COMMENT '百分比模式 合伙人毛利润分佣比例',
  `cost_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '成本模式 服务费成本价收费比例',
  `bank_cost_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '成本模式 到卡服务费成本价收费比例',
  `two_level_partner_id` bigint(20) DEFAULT NULL COMMENT '二级合伙人id',
  `two_level_benefit_ratio` decimal(19,4) DEFAULT NULL COMMENT '二级到上级毛利润分佣比例',
  `two_level_commission_mode` varchar(64) DEFAULT NULL COMMENT '二级的上级模式',
  `two_level_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '二级到上级合伙人到户分佣费率',
  `two_level_bank_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '二级到上级合伙人到卡分佣费率',
  `final_service_amount` decimal(19,2) NOT NULL COMMENT '服务费支出 元',
  `partner_settle_amount` decimal(19,2) NOT NULL COMMENT '分佣金额 元',
  `total_trans_amount` decimal(19,2) NOT NULL COMMENT '批次总金额，单位为元，精确到小数点后两位',
  `total_count` bigint(20) NOT NULL COMMENT '批次总笔数 10 必选',
  `success_amount` decimal(19,2) NOT NULL COMMENT '成功金额 单位为元',
  `success_count` bigint(20) NOT NULL COMMENT '成功笔数',
  `failed_amount` decimal(19,2) NOT NULL COMMENT '失败金额',
  `fail_count` bigint(20) NOT NULL COMMENT '失败笔数',
  `success_bank_amount` decimal(19,2) NOT NULL COMMENT '成功到卡的金额',
  `success_bank_count` bigint(20) NOT NULL COMMENT '成功到卡的笔数',
  `success_alipay_amount` decimal(19,2) NOT NULL COMMENT '成功到支付宝的金额',
  `success_alipay_count` bigint(20) NOT NULL COMMENT '成功到支付宝的笔数',
  `not_free_success_amount` decimal(19,2) NOT NULL COMMENT '不免费的金额',
  `not_free_success_count` bigint(20) NOT NULL COMMENT '不免费的笔数',
  `not_free_success_bank_amount` decimal(19,2) NOT NULL COMMENT '不免费部分到卡的金额',
  `not_free_success_bank_count` bigint(20) NOT NULL COMMENT '不免费部分到卡的笔数',
  `not_free_success_alipay_amount` decimal(19,2) NOT NULL COMMENT '不免费部分成功到支付宝的金额',
  `not_free_success_alipay_count` bigint(20) NOT NULL COMMENT '不免费部分的成功到卡的金额',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `partner_id_user_id_day_type_idx` (`partner_id`,`user_id`,`day`,`type`),
  KEY `partner_id_idx` (`partner_id`),
  KEY `day_idx` (`day`)
) ENGINE=InnoDB AUTO_INCREMENT=161 DEFAULT CHARSET=utf8mb4 COMMENT='合伙人收益统计汇总表';

-- ----------------------------
-- Records of partner_combination_settle_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_daily_stat
-- ----------------------------
DROP TABLE IF EXISTS `partner_daily_stat`;
CREATE TABLE `partner_daily_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `partner_id` bigint(20) NOT NULL COMMENT '合伙人id',
  `day` date NOT NULL COMMENT '日期',
  `register_count` bigint(20) NOT NULL COMMENT '新入驻商户数',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `partner_id_day_idx` (`partner_id`,`day`)
) ENGINE=InnoDB AUTO_INCREMENT=5484 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of partner_daily_stat
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_insider_settle_log
-- ----------------------------
DROP TABLE IF EXISTS `partner_insider_settle_log`;
CREATE TABLE `partner_insider_settle_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `partner_id` bigint(20) NOT NULL COMMENT '合伙人id（内部合伙人）',
  `user_id` bigint(20) NOT NULL COMMENT '商户id',
  `month` int(20) NOT NULL COMMENT '月份',
  `year` int(20) NOT NULL COMMENT '年份',
  `service_ratio` decimal(19,4) NOT NULL COMMENT '到支付宝服务费收费比例',
  `bank_service_ratio` decimal(19,4) NOT NULL COMMENT '到卡服务费收费比例',
  `benefit_ratio` decimal(19,4) NOT NULL COMMENT '合伙人毛利润分佣比例',
  `total_final_service_price` bigint(20) NOT NULL COMMENT '总最终服务费 分',
  `partner_settle_amount` decimal(19,2) NOT NULL COMMENT '员工分拥结算金额 元',
  `total_safe_pay_trans_amount` decimal(19,2) NOT NULL COMMENT '批次总金额，单位为元，精确到小数点后两位，取值范围[0.01,9999999999999.99]  必选',
  `total_safe_pay_count` bigint(20) NOT NULL COMMENT '批次总笔数 10 必选',
  `success_safe_pay_amount` decimal(19,2) NOT NULL COMMENT '成功金额 单位为元',
  `success_safe_pay_count` decimal(19,2) NOT NULL COMMENT '成功笔数',
  `failed_safe_pay_amount` decimal(19,2) NOT NULL COMMENT '失败金额',
  `fail_safe_pay_count` bigint(20) NOT NULL COMMENT '失败笔数',
  `success_safe_pay_bank_amount` decimal(19,2) NOT NULL COMMENT '成功到卡的金额',
  `success_safe_pay_bank_count` bigint(20) NOT NULL COMMENT '成功到卡的笔数',
  `success_safe_pay_alipay_amount` decimal(19,2) NOT NULL COMMENT '成功到支付宝的金额',
  `success_safe_pay_alipay_count` bigint(20) NOT NULL COMMENT '成功到支付宝的笔数',
  `safe_pay_not_free_success_amount` decimal(19,2) NOT NULL COMMENT '不免费的金额',
  `safe_pay_not_free_success_count` bigint(20) NOT NULL COMMENT '不免费的笔数',
  `safe_pay_not_free_success_bank_amount` decimal(19,2) NOT NULL COMMENT '不免费部分到卡的金额',
  `safe_pay_not_free_success_bank_count` bigint(20) NOT NULL COMMENT '不免费部分到卡的笔数',
  `safe_pay_not_free_success_alipay_amount` decimal(19,2) NOT NULL COMMENT '不免费部分成功到支付宝的金额',
  `safe_pay_not_free_success_alipay_count` bigint(20) NOT NULL COMMENT '不免费部分的成功到卡的金额',
  `total_safe_pay_partner_benefit` bigint(20) NOT NULL COMMENT '一级合伙人总收益 分',
  `total_safe_pay_father_partner_benefit` bigint(20) NOT NULL COMMENT '二级合伙人总收益 分',
  `total_safe_pay_platform_benefit` bigint(20) NOT NULL COMMENT '平台总收益 分',
  `safe_pay_final_service_price` bigint(20) NOT NULL COMMENT '最终服务费 分',
  `total_pay_trans_amount` decimal(19,2) NOT NULL COMMENT '批量有密批次总金额，单位为元，精确到小数点后两位，取值范围[0.01,9999999999999.99]  必选',
  `total_pay_trans_count` bigint(20) NOT NULL COMMENT '批量有密批次总笔数 10 必选',
  `success_pay_trans_amount` decimal(19,2) NOT NULL COMMENT '批量有密成功金额 单位为元',
  `success_pay_trans_count` bigint(20) NOT NULL COMMENT '批量有密成功笔数',
  `failed_pay_trans_amount` decimal(19,2) NOT NULL COMMENT '批量有密失败金额',
  `fail_pay_trans_count` bigint(20) NOT NULL COMMENT '批量有密失败笔数',
  `total_pay_trans_partner_benefit` bigint(20) NOT NULL COMMENT '批量有密一级合伙人总收益 分',
  `total_pay_trans_father_partner_benefit` bigint(20) NOT NULL COMMENT '批量有密二级合伙人总收益 分',
  `total_pay_trans_platform_benefit` bigint(20) NOT NULL COMMENT '批量有密平台总收益 分',
  `pay_trans_not_free_success_amount` decimal(19,2) NOT NULL COMMENT '批量有密不免费的成功金额',
  `pay_trans_not_free_success_count` bigint(20) NOT NULL COMMENT '批量有密不免费的成功金额',
  `pay_trans_final_service_price` bigint(20) NOT NULL COMMENT '批量有密最终服务费 分',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_year_month_idx` (`user_id`,`year`,`month`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of partner_insider_settle_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_real_time_stat
-- ----------------------------
DROP TABLE IF EXISTS `partner_real_time_stat`;
CREATE TABLE `partner_real_time_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `service_charge_fee` decimal(19,2) DEFAULT NULL COMMENT '服务费充值金额 单位元 保留2小数',
  `total_count` bigint(20) DEFAULT NULL COMMENT '总转账笔数',
  `pay_trans_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账笔数',
  `safe_pay_trans_count` bigint(20) DEFAULT NULL COMMENT '安全发转账笔数',
  `total_success_count` bigint(20) DEFAULT NULL COMMENT '总转账成功笔数',
  `pay_trans_success_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账成功笔数',
  `safe_pay_trans_success_count` bigint(20) DEFAULT NULL COMMENT '安全发成功转账笔数',
  `total_fail_count` bigint(20) DEFAULT NULL COMMENT '总转账失败笔数',
  `pay_trans_fail_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账失败笔数',
  `safe_pay_trans_fail_count` bigint(20) DEFAULT NULL COMMENT '安全发失败转账笔数',
  `total_service_price` decimal(19,2) DEFAULT NULL COMMENT '总服务费支出 单位元 保留2小数',
  `pay_trans_service_price` decimal(19,2) DEFAULT NULL COMMENT '批量有密服务费支出 单位元 保留2小数',
  `safe_pay_trans_service_price` decimal(19,2) DEFAULT NULL COMMENT '安全发服务费支出 单位元 保留2小数',
  `total_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账金额 单位元 保留2小数',
  `pay_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账金额 单位元 保留2小数',
  `safe_pay_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账金额 单位元 保留2小数',
  `total_success_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账成功金额 单位元 保留2小数',
  `pay_trans_success_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账成功金额 单位元 保留2小数',
  `safe_pay_trans_success_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账成功金额 单位元 保留2小数',
  `total_fail_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账失败金额 单位元 保留2小数',
  `pay_trans_fail_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账失败金额 单位元 保留2小数',
  `safe_pay_trans_fail_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账失败金额 单位元 保留2小数',
  `total_partner_benefit` decimal(19,2) DEFAULT NULL COMMENT '一级合伙人总收益 单位元 保留2小数',
  `total_pay_trans_partner_benefit` decimal(19,2) DEFAULT NULL COMMENT '一级合伙人总收益(批量有密) 单位元 保留2小数',
  `total_safe_pay_trans_partner_benefit` decimal(19,2) DEFAULT NULL COMMENT '一级合伙人总收益(安全发) 单位元 保留2小数',
  `register_count` bigint(20) DEFAULT NULL COMMENT '新入驻商户数',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `partner_id_idx` (`partner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='合伙人实时统计表';

-- ----------------------------
-- Records of partner_real_time_stat
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_safe_pay_settle_log
-- ----------------------------
DROP TABLE IF EXISTS `partner_safe_pay_settle_log`;
CREATE TABLE `partner_safe_pay_settle_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `partner_id` bigint(20) NOT NULL COMMENT '合伙人id',
  `start_day` date NOT NULL COMMENT '开始日期',
  `end_day` date NOT NULL COMMENT '结束日期',
  `benefit` bigint(20) NOT NULL COMMENT '结算金额 分',
  `success_count` bigint(20) NOT NULL COMMENT '结算笔数',
  `success_amount` decimal(19,2) DEFAULT NULL COMMENT '成功总金额',
  `partner_settle_record_ids` text NOT NULL COMMENT '结算统计记录id',
  `stat_snap_json` longtext NOT NULL COMMENT '结算统计记录快照',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `partner_id_idx` (`partner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of partner_safe_pay_settle_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_safe_pay_settle_record
-- ----------------------------
DROP TABLE IF EXISTS `partner_safe_pay_settle_record`;
CREATE TABLE `partner_safe_pay_settle_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `partner_id` bigint(20) NOT NULL COMMENT '合伙人id',
  `day` date NOT NULL COMMENT '日期',
  `benefit` bigint(20) NOT NULL COMMENT '分佣 分',
  `level_one_benefit` bigint(20) NOT NULL COMMENT '一级分佣 分',
  `level_two_benefit` bigint(20) NOT NULL COMMENT '二级分佣 分',
  `success_count` bigint(20) NOT NULL COMMENT '成功笔数',
  `success_amount` decimal(19,2) DEFAULT NULL COMMENT '成功总金额',
  `trans_user_count` bigint(20) DEFAULT NULL COMMENT '转账客户数',
  `level_one_success_count` bigint(20) NOT NULL COMMENT '一级成功笔数',
  `level_two_success_count` bigint(20) NOT NULL COMMENT '二级成功笔数',
  `settled` int(20) NOT NULL COMMENT '是否已结算',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `partner_id_idx` (`partner_id`),
  KEY `day_idx` (`day`)
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=utf8 COMMENT='合伙人安全付分佣结算表';

-- ----------------------------
-- Records of partner_safe_pay_settle_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_settle_log
-- ----------------------------
DROP TABLE IF EXISTS `partner_settle_log`;
CREATE TABLE `partner_settle_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `partner_id` bigint(20) NOT NULL COMMENT '合伙人id',
  `start_day` date NOT NULL COMMENT '开始日期',
  `end_day` date NOT NULL COMMENT '结束日期',
  `benefit` bigint(20) NOT NULL COMMENT '结算金额 分',
  `success_count` bigint(20) NOT NULL COMMENT '结算笔数',
  `success_amount` decimal(19,2) DEFAULT NULL COMMENT '成功总金额',
  `partner_settle_record_ids` text NOT NULL COMMENT '结算统计记录id',
  `stat_snap_json` longtext NOT NULL COMMENT '结算统计记录快照',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `partner_id_idx` (`partner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of partner_settle_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_settle_record
-- ----------------------------
DROP TABLE IF EXISTS `partner_settle_record`;
CREATE TABLE `partner_settle_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `partner_id` bigint(20) NOT NULL COMMENT '合伙人id',
  `day` date NOT NULL COMMENT '日期',
  `benefit` bigint(20) NOT NULL COMMENT '分佣 分',
  `level_one_benefit` bigint(20) NOT NULL COMMENT '一级分佣 分',
  `level_two_benefit` bigint(20) NOT NULL COMMENT '二级分佣 分',
  `success_count` bigint(20) NOT NULL COMMENT '成功笔数',
  `success_amount` decimal(19,2) DEFAULT NULL COMMENT '成功总金额',
  `trans_user_count` bigint(20) DEFAULT NULL COMMENT '转账客户数',
  `level_one_success_count` bigint(20) NOT NULL COMMENT '一级成功笔数',
  `level_two_success_count` bigint(20) NOT NULL COMMENT '二级成功笔数',
  `settled` int(20) NOT NULL COMMENT '是否已结算',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `partner_id_idx` (`partner_id`),
  KEY `day_idx` (`day`)
) ENGINE=InnoDB AUTO_INCREMENT=80 DEFAULT CHARSET=utf8 COMMENT='合伙人分佣结算表';

-- ----------------------------
-- Records of partner_settle_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_user_day_stat
-- ----------------------------
DROP TABLE IF EXISTS `partner_user_day_stat`;
CREATE TABLE `partner_user_day_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `day` date NOT NULL COMMENT '用户交易时间',
  `month` int(20) NOT NULL COMMENT '月份',
  `year` int(20) NOT NULL COMMENT '年份',
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `service_charge_fee` decimal(19,2) NOT NULL COMMENT '服务费充值金额 单位元 保留2小数',
  `total_count` bigint(20) NOT NULL COMMENT '总转账笔数',
  `pay_trans_count` bigint(20) NOT NULL COMMENT '批量有密转账笔数',
  `safe_pay_trans_count` bigint(20) NOT NULL COMMENT '安全发转账笔数',
  `total_success_count` bigint(20) NOT NULL COMMENT '总转账成功笔数',
  `pay_trans_success_count` bigint(20) NOT NULL COMMENT '批量有密转账成功笔数',
  `safe_pay_trans_success_count` bigint(20) NOT NULL COMMENT '安全发成功转账笔数',
  `total_fail_count` bigint(20) NOT NULL COMMENT '总转账失败笔数',
  `pay_trans_fail_count` bigint(20) NOT NULL COMMENT '批量有密转账失败笔数',
  `safe_pay_trans_fail_count` bigint(20) NOT NULL COMMENT '安全发失败转账笔数',
  `total_service_price` decimal(19,2) NOT NULL COMMENT '总服务费支出 单位元 保留2小数',
  `pay_trans_service_price` decimal(19,2) NOT NULL COMMENT '批量有密服务费支出 单位元 保留2小数',
  `safe_pay_trans_service_price` decimal(19,2) NOT NULL COMMENT '安全发服务费支出 单位元 保留2小数',
  `total_trans_amount` decimal(19,2) NOT NULL COMMENT '总转账金额 单位元 保留2小数',
  `pay_trans_amount` decimal(19,2) NOT NULL COMMENT '批量有密转账金额 单位元 保留2小数',
  `safe_pay_trans_amount` decimal(19,2) NOT NULL COMMENT '安全发转账金额 单位元 保留2小数',
  `total_success_trans_amount` decimal(19,2) NOT NULL COMMENT '总转账成功金额 单位元 保留2小数',
  `pay_trans_success_amount` decimal(19,2) NOT NULL COMMENT '批量有密转账成功金额 单位元 保留2小数',
  `safe_pay_trans_success_amount` decimal(19,2) NOT NULL COMMENT '安全发转账成功金额 单位元 保留2小数',
  `total_fail_trans_amount` decimal(19,2) NOT NULL COMMENT '总转账失败金额 单位元 保留2小数',
  `pay_trans_fail_amount` decimal(19,2) NOT NULL COMMENT '批量有密转账失败金额 单位元 保留2小数',
  `safe_pay_trans_fail_amount` decimal(19,2) NOT NULL COMMENT '安全发转账失败金额 单位元 保留2小数',
  `total_partner_benefit` decimal(19,2) NOT NULL COMMENT '一级合伙人总收益 单位元 保留2小数',
  `total_pay_trans_partner_benefit` decimal(19,2) NOT NULL COMMENT '一级合伙人总收益(批量有密) 单位元 保留2小数',
  `total_safe_pay_trans_partner_benefit` decimal(19,2) NOT NULL COMMENT '一级合伙人总收益(安全发) 单位元 保留2小数',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_day_idx` (`user_id`,`day`),
  KEY `day_idx` (`day`),
  KEY `partner_id_idx` (`partner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8mb4 COMMENT='合伙人日统计表';

-- ----------------------------
-- Records of partner_user_day_stat
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_user_filings
-- ----------------------------
DROP TABLE IF EXISTS `partner_user_filings`;
CREATE TABLE `partner_user_filings` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `mobile` varchar(128) DEFAULT NULL COMMENT '开户手机号',
  `business_name` varchar(128) DEFAULT NULL COMMENT '企业名称',
  `business_license` varchar(128) DEFAULT NULL COMMENT '营业执照',
  `biz_scene_desc` varchar(128) DEFAULT NULL COMMENT '业务场景说明书加公章',
  `service_ratio` decimal(19,2) DEFAULT NULL COMMENT '申请费率 单位百分比 0.6 等于 千6',
  `bank_service_ratio` decimal(19,2) DEFAULT NULL COMMENT '到卡申请费率 单位百分比 0.6 等于 千6',
  `audit_status` varchar(128) DEFAULT NULL COMMENT '审核状态',
  `audit_submit_time` datetime DEFAULT NULL COMMENT '审核提交时间',
  `audit_time` datetime DEFAULT NULL COMMENT '审核时间',
  `audit_message` varchar(128) DEFAULT NULL COMMENT '审核信息',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `partner_id_idx` (`partner_id`),
  KEY `mobile_idx` (`mobile`),
  KEY `audit_submit_time_idx` (`audit_submit_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of partner_user_filings
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_user_real_time_stat
-- ----------------------------
DROP TABLE IF EXISTS `partner_user_real_time_stat`;
CREATE TABLE `partner_user_real_time_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `service_charge_fee` decimal(19,2) DEFAULT NULL COMMENT '服务费充值金额 单位元 保留2小数',
  `total_count` bigint(20) DEFAULT NULL COMMENT '总转账笔数',
  `pay_trans_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账笔数',
  `safe_pay_trans_count` bigint(20) DEFAULT NULL COMMENT '安全发转账笔数',
  `total_success_count` bigint(20) DEFAULT NULL COMMENT '总转账成功笔数',
  `pay_trans_success_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账成功笔数',
  `safe_pay_trans_success_count` bigint(20) DEFAULT NULL COMMENT '安全发成功转账笔数',
  `total_fail_count` bigint(20) DEFAULT NULL COMMENT '总转账失败笔数',
  `pay_trans_fail_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账失败笔数',
  `safe_pay_trans_fail_count` bigint(20) DEFAULT NULL COMMENT '安全发失败转账笔数',
  `total_service_price` decimal(19,2) DEFAULT NULL COMMENT '总服务费支出 单位元 保留2小数',
  `pay_trans_service_price` decimal(19,2) DEFAULT NULL COMMENT '批量有密服务费支出 单位元 保留2小数',
  `safe_pay_trans_service_price` decimal(19,2) DEFAULT NULL COMMENT '安全发服务费支出 单位元 保留2小数',
  `total_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账金额 单位元 保留2小数',
  `pay_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账金额 单位元 保留2小数',
  `safe_pay_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账金额 单位元 保留2小数',
  `total_success_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账成功金额 单位元 保留2小数',
  `pay_trans_success_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账成功金额 单位元 保留2小数',
  `safe_pay_trans_success_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账成功金额 单位元 保留2小数',
  `total_fail_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账失败金额 单位元 保留2小数',
  `pay_trans_fail_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账失败金额 单位元 保留2小数',
  `safe_pay_trans_fail_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账失败金额 单位元 保留2小数',
  `total_partner_benefit` decimal(19,2) DEFAULT NULL COMMENT '一级合伙人总收益 单位元 保留2小数',
  `total_pay_trans_partner_benefit` decimal(19,2) DEFAULT NULL COMMENT '一级合伙人总收益(批量有密) 单位元 保留2小数',
  `total_safe_pay_trans_partner_benefit` decimal(19,2) DEFAULT NULL COMMENT '一级合伙人总收益(安全发) 单位元 保留2小数',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_idx` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of partner_user_real_time_stat
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_withdraw_record
-- ----------------------------
DROP TABLE IF EXISTS `partner_withdraw_record`;
CREATE TABLE `partner_withdraw_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `version` bigint(20) NOT NULL COMMENT '版本号',
  `partner_id` bigint(20) NOT NULL COMMENT '合伙人id',
  `status` varchar(64) NOT NULL COMMENT '状态',
  `is_offline` int(20) DEFAULT '0' COMMENT '是否是线下转账 0.不是 1.是',
  `alipay_name` varchar(16) DEFAULT NULL COMMENT '支付宝实名',
  `alipay_account` varchar(64) DEFAULT NULL COMMENT '支付宝收款账号',
  `transfer_money` bigint(20) NOT NULL COMMENT '转账金额 分',
  `end_time` datetime DEFAULT NULL COMMENT '结束时间',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `partner_id_idx` (`partner_id`),
  KEY `end_time_idx` (`end_time`),
  KEY `create_time_idx` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='提现记录';

-- ----------------------------
-- Records of partner_withdraw_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for partner_withdraw_record_batch
-- ----------------------------
DROP TABLE IF EXISTS `partner_withdraw_record_batch`;
CREATE TABLE `partner_withdraw_record_batch` (
  `id` bigint(20) NOT NULL,
  `version` bigint(20) NOT NULL COMMENT '版本号',
  `biz_id` varchar(128) NOT NULL COMMENT '业务号',
  `status` varchar(64) NOT NULL COMMENT '提现状态',
  `is_offline` int(20) DEFAULT '0' COMMENT '是否是线下转账 0.不是 1.是',
  `total_num` int(20) NOT NULL COMMENT '总笔数',
  `total_money` bigint(20) NOT NULL COMMENT '总金额',
  `batch_trans_id` varchar(128) DEFAULT NULL COMMENT '支付宝交易号',
  `last_pay_url` text COMMENT '支付宝付款链接',
  `dealing_time` datetime DEFAULT NULL COMMENT '处理中开始时间',
  `end_time` datetime DEFAULT NULL COMMENT '完成时间',
  `withdraw_record_ids` longtext COMMENT '提现编号集合',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `biz_id_idx` (`biz_id`),
  KEY `end_time_idx` (`end_time`),
  KEY `create_time_idx` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of partner_withdraw_record_batch
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for pay_trans_receipt
-- ----------------------------
DROP TABLE IF EXISTS `pay_trans_receipt`;
CREATE TABLE `pay_trans_receipt` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `pay_trans_id` bigint(20) NOT NULL COMMENT 'pay_trans_id',
  `detail_id` varchar(128) NOT NULL COMMENT '批次明细订单号',
  `file_id` varchar(255) NOT NULL COMMENT '申请回单返回的文件id',
  `last_apply_time` datetime NOT NULL COMMENT '申请回单发起时间',
  `download_url` varchar(1024) DEFAULT NULL COMMENT '文件下载链接长度',
  `status` varchar(16) NOT NULL COMMENT '文件申请状态',
  `error_message` varchar(1024) DEFAULT NULL COMMENT '如果生成失败，则会返回失败原因',
  `end_time` datetime DEFAULT NULL COMMENT '完成时间',
  `next_query_time` datetime NOT NULL COMMENT '下次查询时间',
  `query_count` int(20) NOT NULL COMMENT '查询次数',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `pay_trans_id_idx` (`pay_trans_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='批量转账单笔转账回单查询表';

-- ----------------------------
-- Records of pay_trans_receipt
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for permission
-- ----------------------------
DROP TABLE IF EXISTS `permission`;
CREATE TABLE `permission` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) NOT NULL COMMENT '权限英文名',
  `pid` bigint(20) NOT NULL COMMENT '父权限',
  `alias` varchar(128) NOT NULL COMMENT '权限中文名',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of permission
-- ----------------------------
BEGIN;
INSERT INTO `permission` VALUES (1, 'ADMIN', 0, '超级管理员', '2024-02-18 10:38:33', '2024-02-18 10:38:33');
COMMIT;

-- ----------------------------
-- Table structure for read_notification
-- ----------------------------
DROP TABLE IF EXISTS `read_notification`;
CREATE TABLE `read_notification` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `notification_id` bigint(20) NOT NULL COMMENT '系统通知id',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `notification_id_user_id_idx` (`notification_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户已读系统通知记录表';

-- ----------------------------
-- Records of read_notification
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) NOT NULL COMMENT '角色名',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of role
-- ----------------------------
BEGIN;
INSERT INTO `role` VALUES (1, '超级管理员', '拥有所有权限', '2024-02-18 10:38:32', '2024-02-18 10:38:32');
INSERT INTO `role` VALUES (2, '普通管理员', '拥有部分权限', '2024-02-18 10:38:32', '2024-02-18 10:38:32');
INSERT INTO `role` VALUES (3, '客服', '客服', '2024-02-18 10:38:32', '2024-02-18 10:38:32');
INSERT INTO `role` VALUES (4, '销售', '销售', '2024-02-18 10:38:32', '2024-02-18 10:38:32');
INSERT INTO `role` VALUES (5, '运营', '运营', '2024-02-18 10:38:32', '2024-02-18 10:38:32');
COMMIT;

-- ----------------------------
-- Table structure for role_menu
-- ----------------------------
DROP TABLE IF EXISTS `role_menu`;
CREATE TABLE `role_menu` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `role_id` bigint(20) NOT NULL COMMENT '角色id',
  `menu_id` bigint(20) NOT NULL COMMENT '菜单id',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_id_2` (`role_id`,`menu_id`),
  KEY `role_id` (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of role_menu
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for role_permission
-- ----------------------------
DROP TABLE IF EXISTS `role_permission`;
CREATE TABLE `role_permission` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `role_id` bigint(20) NOT NULL COMMENT '角色id',
  `permission_id` bigint(20) NOT NULL COMMENT '权限id',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_id_2` (`role_id`,`permission_id`),
  KEY `role_id` (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of role_permission
-- ----------------------------
BEGIN;
INSERT INTO `role_permission` VALUES (1, 1, 1, '2024-02-18 10:38:32', '2024-02-18 10:38:32');
COMMIT;

-- ----------------------------
-- Table structure for safe_pay_batch_notify_record
-- ----------------------------
DROP TABLE IF EXISTS `safe_pay_batch_notify_record`;
CREATE TABLE `safe_pay_batch_notify_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `app_id` bigint(20) DEFAULT NULL COMMENT '应用id',
  `import_batch_no` varchar(64) DEFAULT NULL COMMENT '外部批次号',
  `safe_pay_batch_id` bigint(20) NOT NULL COMMENT '批次号',
  `status` int(20) NOT NULL COMMENT '状态',
  `end_time` datetime DEFAULT NULL COMMENT '处理结束时间',
  `notify_count` int(20) NOT NULL COMMENT '通知次数',
  `next_notify_time` datetime NOT NULL COMMENT '下次通知时间',
  `notify_content` longtext COMMENT '通知内容',
  `notify_url` varchar(255) DEFAULT NULL COMMENT '推送地址 长度不超过255',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `safe_pay_batch_id_idx` (`safe_pay_batch_id`),
  KEY `status_next_notify_time_idx` (`status`,`next_notify_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of safe_pay_batch_notify_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for safe_pay_book_pre_apply_record
-- ----------------------------
DROP TABLE IF EXISTS `safe_pay_book_pre_apply_record`;
CREATE TABLE `safe_pay_book_pre_apply_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `alipay_nick_name` varchar(32) NOT NULL COMMENT '支付宝账号',
  `alipay_name` varchar(128) NOT NULL COMMENT '支付宝主体名称',
  `fuzzy_alipay_logon_id` varchar(32) DEFAULT NULL COMMENT '支付宝模糊账号',
  `alipay_uid` varchar(128) DEFAULT NULL COMMENT '支付宝官方用户id 非本系统',
  `book_id` varchar(128) DEFAULT NULL COMMENT '资金账本id',
  `agreement_no` varchar(128) DEFAULT NULL COMMENT '签约协议号',
  `external_agreement_no` varchar(128) DEFAULT NULL COMMENT '外部签约协议号 保证全局唯一',
  `sign_time` varchar(32) DEFAULT NULL COMMENT '签约时间',
  `sign_invalid_time` varchar(32) DEFAULT NULL COMMENT '签约过期时间',
  `login_token` varchar(128) DEFAULT NULL COMMENT '签约返回的（不知道有啥用先存着）',
  `notify_id` varchar(128) DEFAULT NULL COMMENT '签约通知id',
  `ext_card_info` varchar(1024) DEFAULT NULL COMMENT '资金托管账户信息',
  `book_status` int(20) NOT NULL COMMENT '账本开通状态',
  `deadline` datetime NOT NULL COMMENT '申请单过期时间 发起后3天后失效',
  `apply_url` text NOT NULL COMMENT '开通申请链接',
  `apply_token` varchar(32) NOT NULL COMMENT '内部申请token',
  `mounted` int(20) NOT NULL COMMENT '是否已被挂载 已被商户挂载',
  `mounted_user_id` bigint(20) DEFAULT NULL COMMENT '挂载的用户id',
  `mounted_time` datetime DEFAULT NULL COMMENT '挂载时间',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `apply_token_idx` (`apply_token`),
  UNIQUE KEY `external_agreement_no_idx` (`external_agreement_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='安全发记账本预申请单';

-- ----------------------------
-- Records of safe_pay_book_pre_apply_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for safe_pay_business_auth_audit_record
-- ----------------------------
DROP TABLE IF EXISTS `safe_pay_business_auth_audit_record`;
CREATE TABLE `safe_pay_business_auth_audit_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `safe_pay_book_account_id` bigint(20) NOT NULL COMMENT '安全发账号Id',
  `alipay_nick_name` varchar(32) NOT NULL COMMENT '支付宝账号',
  `alipay_uid` varchar(128) DEFAULT NULL COMMENT '支付宝用户id',
  `id_card_front` varchar(255) DEFAULT NULL COMMENT '法人手持身份证正面',
  `id_card_back` varchar(255) DEFAULT NULL COMMENT '法人手持身份证反面',
  `biz_scene_desc` varchar(255) DEFAULT NULL COMMENT '业务场景说明书加公章',
  `merchant_commitment` varchar(255) DEFAULT NULL COMMENT '商户承诺书',
  `icp_info` varchar(255) DEFAULT NULL COMMENT '网站备案信息',
  `business_name` varchar(64) DEFAULT NULL COMMENT '企业名称',
  `biz_license` varchar(255) DEFAULT NULL COMMENT '营业执照',
  `business_license` varchar(255) DEFAULT NULL COMMENT '法人手持营业执照',
  `office_images` varchar(1024) DEFAULT NULL COMMENT '办公室照片',
  `other_one_images` varchar(255) DEFAULT NULL COMMENT '其他资质照片 非必需',
  `other_two_images` varchar(255) DEFAULT NULL COMMENT '其他资质照片 非必需',
  `other_three_images` varchar(255) DEFAULT NULL COMMENT '其他资质照片 非必需',
  `audit_message` varchar(64) DEFAULT NULL COMMENT '审核信息',
  `audit_status` varchar(16) DEFAULT NULL COMMENT '审核状态',
  `audit_submit_time` datetime NOT NULL COMMENT '审核提交时间',
  `audit_time` datetime DEFAULT NULL COMMENT '审核时间',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `safe_pay_book_account_id_idx` (`safe_pay_book_account_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COMMENT='安全发账本账户资质审核表';

-- ----------------------------
-- Records of safe_pay_business_auth_audit_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for safe_pay_excel_template
-- ----------------------------
DROP TABLE IF EXISTS `safe_pay_excel_template`;
CREATE TABLE `safe_pay_excel_template` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `name` varchar(128) NOT NULL COMMENT '姓名',
  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
  `type` varchar(16) NOT NULL COMMENT '类型',
  `identity_column_index` int(20) NOT NULL COMMENT '收款账号索引 从1开始',
  `name_column_index` int(20) NOT NULL COMMENT '收款账号姓名索引 从1开始',
  `amount_column_index` int(20) NOT NULL COMMENT '金额索引 从1开始',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_name_idx` (`user_id`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='安全付自定义excel表格';

-- ----------------------------
-- Records of safe_pay_excel_template
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for safe_pay_order_receipt
-- ----------------------------
DROP TABLE IF EXISTS `safe_pay_order_receipt`;
CREATE TABLE `safe_pay_order_receipt` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `safe_pay_order_id` bigint(20) NOT NULL COMMENT 'safe_pay_order_id',
  `agreement_no` varchar(128) NOT NULL COMMENT 'ISV与商户签约授权协议号',
  `pay_fund_order_id` varchar(128) NOT NULL COMMENT '支付宝支付资金流水号，仅当转账成功才会返回该参数',
  `file_id` varchar(255) NOT NULL COMMENT '申请回单返回的文件id',
  `last_apply_time` datetime NOT NULL COMMENT '申请回单发起时间',
  `download_url` varchar(1024) DEFAULT NULL COMMENT '文件下载链接长度',
  `status` varchar(16) NOT NULL COMMENT '文件申请状态',
  `error_message` varchar(1024) DEFAULT NULL COMMENT '如果生成失败，则会返回失败原因',
  `end_time` datetime DEFAULT NULL COMMENT '完成时间',
  `next_query_time` datetime NOT NULL COMMENT '下次查询时间',
  `query_count` int(20) NOT NULL COMMENT '查询次数',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `safe_pay_order_id_idx` (`safe_pay_order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='安全发单笔转账回单查询表';

-- ----------------------------
-- Records of safe_pay_order_receipt
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for serial_number
-- ----------------------------
DROP TABLE IF EXISTS `serial_number`;
CREATE TABLE `serial_number` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) NOT NULL,
  `step` bigint(20) NOT NULL,
  `next_val` bigint(20) DEFAULT NULL,
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name_idx` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of serial_number
-- ----------------------------
BEGIN;
INSERT INTO `serial_number` VALUES (1, 'common', 1000, 1, '2020-04-28 10:06:24', '2020-06-08 14:59:10');
INSERT INTO `serial_number` VALUES (2, 'pay_trans_batch', 1000, 1, '2020-05-01 00:00:00', '2024-07-10 10:14:50');
INSERT INTO `serial_number` VALUES (3, 'pay_trans', 1000, 1, '2020-05-01 00:00:00', '2024-07-10 10:14:50');
INSERT INTO `serial_number` VALUES (4, 'pay_trans_summary', 1000, 1, '2020-05-01 00:00:00', '2021-07-23 10:26:22');
INSERT INTO `serial_number` VALUES (5, 'pay_trans_record', 1000, 1, '2020-05-01 00:00:00', '2021-07-23 12:35:03');
INSERT INTO `serial_number` VALUES (6, 'account_log', 1000, 1, '2020-05-01 00:00:00', '2024-07-10 02:00:02');
INSERT INTO `serial_number` VALUES (7, 'account_detail', 1000, 1, '2020-05-01 00:00:00', '2024-07-10 02:00:02');
INSERT INTO `serial_number` VALUES (8, 'charge_record', 1000, 1, '2020-05-01 00:00:00', '2024-07-03 15:57:30');
INSERT INTO `serial_number` VALUES (9, 'alipay_user', 1000, 1, '2020-05-01 00:00:00', '2024-02-22 11:02:50');
INSERT INTO `serial_number` VALUES (10, 'taoke_detection_record', 1000, 1, '2020-05-01 00:00:00', '2020-06-11 15:22:52');
INSERT INTO `serial_number` VALUES (11, 'taoke_detection_batch', 1000, 1, '2020-05-01 00:00:00', '2020-06-11 15:22:52');
INSERT INTO `serial_number` VALUES (12, 'partner_withdraw_record_batch', 1000, 1, '2020-05-01 00:00:00', '2021-03-30 01:00:00');
INSERT INTO `serial_number` VALUES (13, 'safe_pay_book_account', 1000, 1, '2020-05-01 00:00:00', '2024-07-10 10:27:44');
INSERT INTO `serial_number` VALUES (14, 'book_account_charge_order', 1000, 1, '2020-05-01 00:00:00', '2024-07-03 15:52:58');
INSERT INTO `serial_number` VALUES (15, 'safe_pay_batch', 1000, 1, '2020-05-01 00:00:00', '2024-07-08 16:11:40');
INSERT INTO `serial_number` VALUES (16, 'safe_pay_order', 1000, 1, '2020-05-01 00:00:00', '2024-07-08 16:11:40');
INSERT INTO `serial_number` VALUES (17, 'user_withdraw_record', 1000, 1, '2021-12-06 16:16:39', '2024-07-02 09:53:29');
INSERT INTO `serial_number` VALUES (18, 'collection_order', 1000, 1, '2021-12-06 16:16:39', '2021-12-29 11:25:58');
INSERT INTO `serial_number` VALUES (19, 'collection_batch', 1000, 1, '2021-12-06 16:16:39', '2022-01-11 17:30:38');
INSERT INTO `serial_number` VALUES (20, 'auto_pay_batch', 1000, 1, '2021-12-06 16:16:39', '2022-01-15 10:39:48');
INSERT INTO `serial_number` VALUES (21, 'auto_pay_order', 1000, 1, '2021-12-06 16:16:39', '2022-01-15 10:39:48');
INSERT INTO `serial_number` VALUES (22, 'auto_pay_receipt_account', 1000, 1, '2021-12-06 16:16:39', '2022-03-07 15:23:11');
INSERT INTO `serial_number` VALUES (23, 'auto_pay_trans_batch', 1000, 1, '2021-12-06 16:16:39', '2022-03-07 19:10:24');
INSERT INTO `serial_number` VALUES (24, 'collection_safe_pay_order', 1000, 1, '2022-01-01 00:00:00', '2022-10-21 16:50:13');
INSERT INTO `serial_number` VALUES (25, 'collection_safe_pay_batch', 1000, 1, '2022-01-01 00:00:00', '2022-10-24 17:31:58');
INSERT INTO `serial_number` VALUES (26, 'flexible_staff_card_order', 1000, 1, '2023-08-10 16:20:11', '2023-08-10 16:20:11');
COMMIT;

-- ----------------------------
-- Table structure for shard_config
-- ----------------------------
DROP TABLE IF EXISTS `shard_config`;
CREATE TABLE `shard_config` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `data_source_name` varchar(64) DEFAULT NULL,
  `shard_id` bigint(20) DEFAULT NULL,
  `driver_class` varchar(128) DEFAULT NULL,
  `host` varchar(128) DEFAULT NULL,
  `port` bigint(20) DEFAULT NULL,
  `db_name` varchar(128) DEFAULT NULL,
  `user` varchar(64) DEFAULT NULL,
  `password` varchar(64) DEFAULT NULL,
  `comment` varchar(512) DEFAULT NULL,
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `data_source_name_idx` (`data_source_name`) COMMENT 'data_source_name'
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of shard_config
-- ----------------------------
BEGIN;
INSERT INTO `shard_config` VALUES (1, 'xpay', 0, 'com.mysql.jdbc.Driver', '127.0.0.1', 3306, 'xpay_dev_0', 'root', '123456', '', '2024-02-18 10:38:32', '2024-02-18 10:38:32');
INSERT INTO `shard_config` VALUES (2, 'xpay', 1, 'com.mysql.jdbc.Driver', '127.0.0.1', 3306, 'xpay_dev_1', 'root', '123456', '', '2024-02-18 10:38:32', '2024-02-18 10:38:32');
COMMIT;

-- ----------------------------
-- Table structure for shard_setting
-- ----------------------------
DROP TABLE IF EXISTS `shard_setting`;
CREATE TABLE `shard_setting` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `data_source_name` varchar(64) DEFAULT NULL,
  `key` varchar(64) DEFAULT NULL,
  `value` varchar(64) DEFAULT NULL,
  `comment` varchar(512) DEFAULT NULL,
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of shard_setting
-- ----------------------------
BEGIN;
INSERT INTO `shard_setting` VALUES (1, 'xpay', 'shard_count', '2', '', '2024-02-18 10:38:32', '2024-02-18 10:38:32');
COMMIT;

-- ----------------------------
-- Table structure for site_config
-- ----------------------------
DROP TABLE IF EXISTS `site_config`;
CREATE TABLE `site_config` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(8) NOT NULL COMMENT '网站名',
  `record_information` varchar(64) DEFAULT NULL COMMENT '网站备案信息',
  `wechat_qr_code` varchar(255) DEFAULT NULL COMMENT '微信二维码',
  `letter_code` varchar(64) DEFAULT NULL COMMENT '网站名字字母代号（2个字母大写）',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of site_config
-- ----------------------------
BEGIN;
INSERT INTO `site_config` VALUES (1, '测试网', '测试网 - ICP备00000000号-1', '', 'TS', '2024-02-18 10:38:32', '2024-02-18 10:38:32');
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `version` bigint(20) NOT NULL COMMENT '版本号',
  `mobile` varchar(16) NOT NULL COMMENT '手机号',
  `uid` varchar(32) DEFAULT NULL COMMENT '唯一失败码',
  `collect_qrcode` varchar(255) DEFAULT NULL COMMENT '收集收款信息二维码',
  `app_version` varchar(64) NOT NULL DEFAULT 'normal' COMMENT '软件版本',
  `outer_id` varchar(64) DEFAULT NULL COMMENT '外部用户id',
  `channel_master_user_id` bigint(20) DEFAULT NULL COMMENT '渠道主用户id',
  `password` varchar(128) DEFAULT NULL COMMENT '密码',
  `pay_password` varchar(128) DEFAULT NULL COMMENT '支付密码',
  `alipay_nick_name` varchar(128) DEFAULT NULL COMMENT '当前使用的支付宝账号',
  `alipay_user_id` bigint(20) DEFAULT NULL COMMENT '当前使用的支付宝账号id',
  `service_unit_price` bigint(20) NOT NULL COMMENT '转账服务费单价 分',
  `bank_service_unit_price` bigint(20) DEFAULT NULL COMMENT '到卡转账服务费单价 分',
  `service_real_price` bigint(20) NOT NULL COMMENT '实际转账服务费单价 分',
  `taoke_unit_price` bigint(20) DEFAULT NULL COMMENT '淘客检测单价 分',
  `name` varchar(64) DEFAULT NULL COMMENT '姓名',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `volume_desc` varchar(64) DEFAULT NULL COMMENT '体量描述',
  `partner_remark` varchar(255) DEFAULT NULL COMMENT '合伙人写的备注',
  `charge_time` datetime DEFAULT NULL COMMENT '首次充值时间',
  `last_charge_time` datetime DEFAULT NULL COMMENT '最近充值时间',
  `register_time` datetime NOT NULL COMMENT '注册时间',
  `register_ip` varchar(32) DEFAULT NULL COMMENT '注册ip',
  `last_login_time` datetime DEFAULT NULL COMMENT '上次登录时间',
  `last_login_client` varchar(16) DEFAULT NULL COMMENT '上次登录客户端',
  `last_login_ip` varchar(128) DEFAULT NULL COMMENT '上次登录ip',
  `login_count` bigint(20) DEFAULT NULL COMMENT '总登录次数',
  `security_status` int(20) DEFAULT NULL COMMENT '安全状态',
  `security_remark` varchar(32) DEFAULT NULL COMMENT '安全备注',
  `error_count` int(20) NOT NULL COMMENT '登录出错的次数',
  `appkey` varchar(32) DEFAULT NULL COMMENT '接口调用appkey',
  `secret` varchar(32) DEFAULT NULL COMMENT '接口调用secret',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `mode` varchar(64) DEFAULT NULL COMMENT '服务费收费模式',
  `commission_mode` varchar(128) DEFAULT NULL COMMENT '分佣模式',
  `service_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费比例',
  `bank_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '到卡服务费收费比例',
  `benefit_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费分成比例',
  `father_benefit_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费分成比例',
  `father_commission_mode` varchar(64) DEFAULT NULL COMMENT '上级模式',
  `father_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '上级合伙人到户分佣费率',
  `father_bank_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '上级合伙人到卡分佣费率',
  `cost_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费成本价收费比例',
  `bank_cost_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '到卡服务费成本价收费比例',
  `partner_benefit` bigint(20) DEFAULT NULL COMMENT '合伙人分佣',
  `father_partner_id` bigint(20) DEFAULT NULL COMMENT '父级合伙人id',
  `father_partner_benefit` bigint(20) DEFAULT NULL COMMENT '父级合伙人分佣 分',
  `user_tag` varchar(16) DEFAULT NULL COMMENT '用户标签 平台、商家等',
  `industry_category` varchar(16) DEFAULT NULL COMMENT '行业类目',
  `pma` varchar(128) DEFAULT NULL COMMENT '合伙人邀请码',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `mobile_idx` (`mobile`),
  UNIQUE KEY `outer_id_channel_master_user_id_idx` (`outer_id`,`channel_master_user_id`),
  UNIQUE KEY `uid_idx` (`uid`),
  KEY `partner_id_idx` (`partner_id`),
  KEY `father_partner_id_idx` (`father_partner_id`),
  KEY `register_time_idx` (`register_time`),
  KEY `last_login_time_idx` (`register_time`),
  KEY `last_charge_time_idx` (`last_charge_time`)
) ENGINE=InnoDB AUTO_INCREMENT=10015 DEFAULT CHARSET=utf8 COMMENT='用户';

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user_account_money_left_stat
-- ----------------------------
DROP TABLE IF EXISTS `user_account_money_left_stat`;
CREATE TABLE `user_account_money_left_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '商户编号',
  `day` date NOT NULL COMMENT '日期',
  `before_money_left` bigint(20) NOT NULL COMMENT '变动前留存 单位分',
  `change_money` bigint(20) NOT NULL COMMENT '变动金额 单位分',
  `money_left` bigint(20) NOT NULL COMMENT '剩余的money 单位分',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_day_idx` (`user_id`,`day`),
  KEY `day` (`day`)
) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8mb4 COMMENT='商户每日服务费余额留存表';

-- ----------------------------
-- Records of user_account_money_left_stat
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user_business_auth
-- ----------------------------
DROP TABLE IF EXISTS `user_business_auth`;
CREATE TABLE `user_business_auth` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `business_license` varchar(255) DEFAULT NULL COMMENT '营业执照',
  `business_name` varchar(128) DEFAULT NULL COMMENT '企业名称',
  `uniform_social_credit_code` varchar(128) DEFAULT NULL COMMENT '统一社会信用代码',
  `id_card_front` varchar(255) DEFAULT NULL COMMENT '法人身份证正面',
  `id_card_back` varchar(255) DEFAULT NULL COMMENT '法人身份证反面',
  `name` varchar(128) DEFAULT NULL COMMENT '法人姓名',
  `id_card` varchar(64) DEFAULT NULL COMMENT '法人身份证号',
  `phone` varchar(64) DEFAULT NULL COMMENT '法人手机号',
  `audit_message` varchar(128) DEFAULT NULL COMMENT '审核信息',
  `user_business_auth_audit_status` varchar(64) DEFAULT NULL COMMENT '审核状态',
  `audit_submit_time` datetime DEFAULT NULL COMMENT '审核提交时间',
  `audit_time` datetime DEFAULT NULL COMMENT '审核时间',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id_idx` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of user_business_auth
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user_daily_stat
-- ----------------------------
DROP TABLE IF EXISTS `user_daily_stat`;
CREATE TABLE `user_daily_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `day` date NOT NULL COMMENT '用户当天的交易的时间',
  `month` int(20) NOT NULL COMMENT '月份',
  `year` int(20) NOT NULL COMMENT '年份',
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `service_charge_fee` decimal(19,2) DEFAULT NULL COMMENT '服务费充值金额 单位元 保留2小数',
  `total_count` bigint(20) DEFAULT NULL COMMENT '总转账笔数',
  `total_success_count` bigint(20) DEFAULT NULL COMMENT '总转账成功笔数',
  `total_fail_count` bigint(20) DEFAULT NULL COMMENT '总转账失败笔数',
  `total_success_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 总转账成功笔数',
  `total_fail_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 总转账失败笔数',
  `total_success_large_count` bigint(20) DEFAULT NULL COMMENT '单笔超过10000元 总转账成功笔数',
  `total_service_price` decimal(19,2) DEFAULT NULL COMMENT '总服务费支出 单位元 保留2小数',
  `total_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账金额 单位元 保留2小数',
  `total_success_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账成功金额 单位元 保留2小数',
  `total_fail_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账失败金额 单位元 保留2小数',
  `total_benefit` decimal(19,2) DEFAULT NULL COMMENT '平台服务费总收益 单位元 保留2小数',
  `pay_trans_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账笔数',
  `pay_trans_success_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账成功笔数',
  `pay_trans_fail_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账失败笔数',
  `pay_trans_very_alipay_user_count` bigint(20) DEFAULT NULL COMMENT '批量有密付款超过500万的账户数',
  `pay_trans_success_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 批量有密转账成功笔数',
  `pay_trans_fail_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 批量有密转账失败笔数',
  `pay_trans_success_large_count` bigint(20) DEFAULT NULL COMMENT '单笔超过10000元 批量有密转账成功笔数',
  `pay_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账金额 单位元 保留2小数',
  `pay_trans_success_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账成功金额 单位元 保留2小数',
  `pay_trans_fail_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账失败金额 单位元 保留2小数',
  `pay_trans_service_price` decimal(19,2) DEFAULT NULL COMMENT '批量有密服务费支出 单位元 保留2小数',
  `total_pay_trans_benefit` decimal(19,2) DEFAULT NULL COMMENT '平台服务费总收益(批量有密) 单位元 保留2小数',
  `safe_pay_trans_count` bigint(20) DEFAULT NULL COMMENT '安全发转账笔数',
  `safe_pay_trans_success_count` bigint(20) DEFAULT NULL COMMENT '安全发成功转账笔数',
  `safe_pay_trans_fail_count` bigint(20) DEFAULT NULL COMMENT '安全发失败转账笔数',
  `safe_pay_trans_very_alipay_user_count` bigint(20) DEFAULT NULL COMMENT '安全发款超过500万的账户数',
  `safe_pay_trans_success_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 安全发成功转账笔数',
  `safe_pay_trans_fail_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 安全发失败转账笔数',
  `safe_pay_trans_success_large_count` bigint(20) DEFAULT NULL COMMENT '单笔超过10000元 安全发成功转账笔数',
  `safe_pay_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账金额 单位元 保留2小数',
  `safe_pay_trans_success_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账成功金额 单位元 保留2小数',
  `safe_pay_trans_fail_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账失败金额 单位元 保留2小数',
  `safe_pay_trans_service_price` decimal(19,2) DEFAULT NULL COMMENT '安全发服务费支出 单位元 保留2小数',
  `total_safe_pay_trans_benefit` decimal(19,2) DEFAULT NULL COMMENT '平台服务费总收益(安全发) 单位元 保留2小数',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_day_idx` (`user_id`,`day`),
  KEY `day_idx` (`day`),
  KEY `partner_id_idx` (`partner_id`)
) ENGINE=InnoDB AUTO_INCREMENT=363 DEFAULT CHARSET=utf8mb4 COMMENT='用户经营数据表';

-- ----------------------------
-- Records of user_daily_stat
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user_profile
-- ----------------------------
DROP TABLE IF EXISTS `user_profile`;
CREATE TABLE `user_profile` (
  `id` bigint(20) NOT NULL,
  `api_version` int(20) NOT NULL COMMENT '开放接口版本',
  `open_charge` int(20) NOT NULL COMMENT '是否开启充值页面',
  `open_safe_pay` int(20) DEFAULT '0' COMMENT '是否开启安全付接口 默认不开启',
  `need_safe_pay_auth` int(20) DEFAULT '1' COMMENT '是否验证安全付账号有无实名认证 默认是',
  `open_auto_pay` int(20) DEFAULT '0' COMMENT '是否开启自动付接口 默认不开启',
  `open_safe_pay_offline_charge` int(20) DEFAULT '0' COMMENT '是否开启安全付汇款转账 默认不开启',
  `open_collection_safe_pay` int(20) DEFAULT '0' COMMENT '是否开启安全付收集到卡功能 默认不开启',
  `open_charge_notify` int(20) DEFAULT NULL COMMENT '是否开启充值通知回调',
  `open_invoice` int(20) DEFAULT NULL COMMENT '是否开启开放开具发票 默认不开启',
  `open_safe_pay_bank` int(20) DEFAULT NULL COMMENT '是否开启开放安全发到卡 默认开启',
  `limit_safe_pay_web_page_trans` int(20) DEFAULT NULL COMMENT '限制安全发网页转账操作 只能通过接口转账',
  `open_safe_pay_new_sign_method` int(20) DEFAULT '0' COMMENT '是否开放开全发签约授权新方式',
  `strict_login` int(20) DEFAULT NULL COMMENT '是否开启严格登录认证',
  `use_google_auth` int(20) DEFAULT NULL COMMENT '启用谷歌验证器',
  `google_auth_key` varchar(128) DEFAULT NULL COMMENT '谷歌验证器秘钥',
  `google_auth_qrcode` varchar(128) DEFAULT NULL COMMENT '谷歌验证器二维码',
  `charge_notify_url` varchar(512) DEFAULT NULL COMMENT '充值通知回调地址',
  `open_safe_pay_notify` int(20) DEFAULT NULL COMMENT '是否开启安全付通知',
  `safe_pay_notify_url` varchar(255) DEFAULT NULL COMMENT '安全付通知回调地址',
  `batch_ensure` int(20) DEFAULT NULL COMMENT '安全付批次转账是否需要短信验证码验证',
  `ensure_batch_amount` decimal(19,2) DEFAULT NULL COMMENT '安全付批次转账验证金额阈值 单位元',
  `receive_mobile` varchar(16) DEFAULT NULL COMMENT '安全付接收短信验证码的手机号',
  `spare_receive_mobile` varchar(16) DEFAULT NULL COMMENT '备用的接受短信验证码的手机号',
  `trans_amount_day_limit` decimal(19,2) DEFAULT NULL COMMENT '转账日限额度 元',
  `safe_pay_trans_amount_day_limit` decimal(19,2) DEFAULT NULL COMMENT '安全付单个支付宝转账日限额 元',
  `no_wechat_qr_code` int(20) DEFAULT NULL COMMENT '不显示网站客服微信',
  `open_merchant_platform` int(20) DEFAULT NULL COMMENT '是否开放商户平台',
  `white_ips` text COMMENT '接口ip白名单',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `google_auth_key_idx` (`google_auth_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of user_profile
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user_real_time_stat
-- ----------------------------
DROP TABLE IF EXISTS `user_real_time_stat`;
CREATE TABLE `user_real_time_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `service_charge_fee` decimal(19,2) DEFAULT NULL COMMENT '服务费充值金额 单位元 保留2小数',
  `total_count` bigint(20) DEFAULT NULL COMMENT '总转账笔数',
  `total_success_count` bigint(20) DEFAULT NULL COMMENT '总转账成功笔数',
  `total_fail_count` bigint(20) DEFAULT NULL COMMENT '总转账失败笔数',
  `total_success_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 总转账成功笔数',
  `total_fail_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 总转账失败笔数',
  `total_success_large_count` bigint(20) DEFAULT NULL COMMENT '单笔超过10000元 总转账成功笔数',
  `total_service_price` decimal(19,2) DEFAULT NULL COMMENT '总服务费支出 单位元 保留2小数',
  `total_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账金额 单位元 保留2小数',
  `total_success_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账成功金额 单位元 保留2小数',
  `total_fail_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '总转账失败金额 单位元 保留2小数',
  `total_benefit` decimal(19,2) DEFAULT NULL COMMENT '总服务费总收益 单位元 保留2小数',
  `pay_trans_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账笔数',
  `pay_trans_success_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账成功笔数',
  `pay_trans_fail_count` bigint(20) DEFAULT NULL COMMENT '批量有密转账失败笔数',
  `pay_trans_very_alipay_user_count` bigint(20) DEFAULT NULL COMMENT '批量有密付款超过500万的账户数',
  `pay_trans_success_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 批量有密转账成功笔数',
  `pay_trans_fail_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 批量有密转账失败笔数',
  `pay_trans_success_large_count` bigint(20) DEFAULT NULL COMMENT '单笔超过10000元 批量有密转账成功笔数',
  `pay_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账金额 单位元 保留2小数',
  `pay_trans_success_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账成功金额 单位元 保留2小数',
  `pay_trans_fail_amount` decimal(19,2) DEFAULT NULL COMMENT '批量有密转账失败金额 单位元 保留2小数',
  `pay_trans_service_price` decimal(19,2) DEFAULT NULL COMMENT '批量有密服务费支出 单位元 保留2小数',
  `total_pay_trans_benefit` decimal(19,2) DEFAULT NULL COMMENT '平台服务费总收益(批量有密) 单位元 保留2小数',
  `safe_pay_trans_count` bigint(20) DEFAULT NULL COMMENT '安全发转账笔数',
  `safe_pay_trans_success_count` bigint(20) DEFAULT NULL COMMENT '安全发成功转账笔数',
  `safe_pay_trans_fail_count` bigint(20) DEFAULT NULL COMMENT '安全发失败转账笔数',
  `safe_pay_trans_very_alipay_user_count` bigint(20) DEFAULT NULL COMMENT '安全发款超过500万的账户数',
  `safe_pay_trans_success_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 安全发成功转账笔数',
  `safe_pay_trans_fail_single_very_count` bigint(20) DEFAULT NULL COMMENT '单笔超过500元 安全发失败转账笔数',
  `safe_pay_trans_success_large_count` bigint(20) DEFAULT NULL COMMENT '单笔超过10000元 安全发成功转账笔数',
  `safe_pay_trans_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账金额 单位元 保留2小数',
  `safe_pay_trans_success_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账成功金额 单位元 保留2小数',
  `safe_pay_trans_fail_amount` decimal(19,2) DEFAULT NULL COMMENT '安全发转账失败金额 单位元 保留2小数',
  `safe_pay_trans_service_price` decimal(19,2) DEFAULT NULL COMMENT '安全发服务费支出 单位元 保留2小数',
  `total_safe_pay_trans_benefit` decimal(19,2) DEFAULT NULL COMMENT '平台服务费总收益(安全发) 单位元 保留2小数',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_idx` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='用户实时经营数据表';

-- ----------------------------
-- Records of user_real_time_stat
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user_registration
-- ----------------------------
DROP TABLE IF EXISTS `user_registration`;
CREATE TABLE `user_registration` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `mobile` varchar(16) DEFAULT NULL COMMENT '手机号',
  `business_license` varchar(255) DEFAULT NULL COMMENT '营业执照',
  `id_card_front` varchar(255) DEFAULT NULL COMMENT '法人身份证正面',
  `id_card_back` varchar(255) DEFAULT NULL COMMENT '法人身份证反面',
  `biz_scene_desc` varchar(255) DEFAULT NULL COMMENT '业务场景说明书加公章',
  `merchant_commitment` varchar(255) DEFAULT NULL COMMENT '商户承诺书',
  `service_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费比例',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id_idx` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户备案信息';

-- ----------------------------
-- Records of user_registration
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user_safe_pay_trans_month_stat
-- ----------------------------
DROP TABLE IF EXISTS `user_safe_pay_trans_month_stat`;
CREATE TABLE `user_safe_pay_trans_month_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `month` int(20) NOT NULL COMMENT '月份',
  `year` int(20) NOT NULL COMMENT '年份',
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `father_partner_id` bigint(20) DEFAULT NULL COMMENT '父合伙人id',
  `total_trans_amount` varchar(128) NOT NULL COMMENT '"批次总金额，单位为元，精确到小数点后两位，取值范围[0.01,9999999999999.99]  必选',
  `total_count` bigint(20) NOT NULL COMMENT '批次总笔数 10 必选',
  `success_amount` varchar(128) NOT NULL COMMENT '成功金额 单位为元',
  `success_count` bigint(20) NOT NULL COMMENT '成功笔数',
  `failed_amount` varchar(128) NOT NULL COMMENT '失败金额',
  `fail_count` bigint(20) DEFAULT NULL COMMENT '失败笔数',
  `success_bank_amount` varchar(128) DEFAULT NULL COMMENT '成功到卡金额',
  `success_bank_count` bigint(20) DEFAULT NULL COMMENT '成功到卡笔数',
  `success_alipay_amount` varchar(128) DEFAULT NULL COMMENT '成功到支付宝金额',
  `success_alipay_count` bigint(20) DEFAULT NULL COMMENT '成功到支付宝笔数',
  `not_free_success_amount` varchar(128) DEFAULT NULL COMMENT '不免费成功金额',
  `not_free_success_count` bigint(20) DEFAULT NULL COMMENT '不免费成功笔数',
  `not_free_success_bank_amount` varchar(128) DEFAULT NULL COMMENT '不免费成功到卡金额',
  `not_free_success_bank_count` bigint(20) DEFAULT NULL COMMENT '不免费成功到卡笔数',
  `not_free_success_alipay_amount` varchar(128) DEFAULT NULL COMMENT '不免费成功到支付宝金额',
  `not_free_success_alipay_count` bigint(20) DEFAULT NULL COMMENT '不免费成功到支付宝笔数',
  `total_partner_benefit` bigint(20) DEFAULT NULL COMMENT '一级合伙人总收益 分',
  `total_father_partner_benefit` bigint(20) DEFAULT NULL COMMENT '二级合伙人总收益 分',
  `total_platform_benefit` bigint(20) DEFAULT NULL COMMENT '平台总收益 分',
  `final_service_price` bigint(20) DEFAULT NULL COMMENT '最终服务费 分',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_year_month_idx` (`user_id`,`year`,`month`,`partner_id`,`father_partner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户安全付转账月统计表';

-- ----------------------------
-- Records of user_safe_pay_trans_month_stat
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user_safe_pay_trans_stat
-- ----------------------------
DROP TABLE IF EXISTS `user_safe_pay_trans_stat`;
CREATE TABLE `user_safe_pay_trans_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `day` date NOT NULL COMMENT '用户交易时间',
  `month` int(20) NOT NULL COMMENT '月份',
  `year` int(20) NOT NULL COMMENT '年份',
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `father_partner_id` bigint(20) DEFAULT NULL COMMENT '父合伙人id',
  `total_trans_amount` varchar(128) NOT NULL COMMENT '"批次总金额，单位为元，精确到小数点后两位，取值范围[0.01,9999999999999.99]  必选',
  `total_count` bigint(20) NOT NULL COMMENT '批次总笔数 10 必选',
  `success_amount` varchar(128) NOT NULL COMMENT '成功金额 单位为元',
  `success_count` bigint(20) NOT NULL COMMENT '成功笔数',
  `failed_amount` varchar(128) NOT NULL COMMENT '失败金额',
  `fail_count` bigint(20) DEFAULT NULL COMMENT '失败笔数',
  `success_bank_amount` varchar(128) DEFAULT NULL COMMENT '成功到卡金额',
  `success_bank_count` bigint(20) DEFAULT NULL COMMENT '成功到卡笔数',
  `success_alipay_amount` varchar(128) DEFAULT NULL COMMENT '成功到支付宝金额',
  `success_alipay_count` bigint(20) DEFAULT NULL COMMENT '成功到支付宝笔数',
  `not_free_success_amount` varchar(128) DEFAULT NULL COMMENT '不免费成功金额',
  `not_free_success_count` bigint(20) DEFAULT NULL COMMENT '不免费成功笔数',
  `not_free_success_bank_amount` varchar(128) DEFAULT NULL COMMENT '不免费成功到卡金额',
  `not_free_success_bank_count` bigint(20) DEFAULT NULL COMMENT '不免费成功到卡笔数',
  `not_free_success_alipay_amount` varchar(128) DEFAULT NULL COMMENT '不免费成功到支付宝金额',
  `not_free_success_alipay_count` bigint(20) DEFAULT NULL COMMENT '不免费成功到支付宝笔数',
  `book_account_charge_amount` decimal(19,2) DEFAULT NULL COMMENT '本金成功充值金额 单位元 保留2位小数',
  `total_partner_benefit` bigint(20) DEFAULT NULL COMMENT '一级合伙人总收益 分',
  `total_father_partner_benefit` bigint(20) DEFAULT NULL COMMENT '二级合伙人总收益 分',
  `total_platform_benefit` bigint(20) DEFAULT NULL COMMENT '平台总收益 分',
  `final_service_price` bigint(20) DEFAULT NULL COMMENT '最终服务费 分',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_day_idx` (`user_id`,`day`),
  KEY `user_id_idx` (`user_id`),
  KEY `day_idx` (`day`)
) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8mb4 COMMENT='用户安全付转账统计表';

-- ----------------------------
-- Records of user_safe_pay_trans_stat
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user_shard
-- ----------------------------
DROP TABLE IF EXISTS `user_shard`;
CREATE TABLE `user_shard` (
  `id` bigint(20) NOT NULL,
  `version` bigint(20) NOT NULL COMMENT '版本号',
  `shard_id` bigint(20) NOT NULL COMMENT '分库id',
  `mobile` varchar(16) NOT NULL COMMENT '手机号',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户分库信息';

-- ----------------------------
-- Records of user_shard
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user_trans_month_stat
-- ----------------------------
DROP TABLE IF EXISTS `user_trans_month_stat`;
CREATE TABLE `user_trans_month_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `month` int(20) NOT NULL COMMENT '月份',
  `year` int(20) NOT NULL COMMENT '年份',
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `father_partner_id` bigint(20) DEFAULT NULL COMMENT '父合伙人id',
  `total_trans_amount` varchar(128) NOT NULL COMMENT '"批次总金额，单位为元，精确到小数点后两位，取值范围[0.01,9999999999999.99]  必选',
  `total_count` bigint(20) NOT NULL COMMENT '批次总笔数 10 必选',
  `success_amount` varchar(128) NOT NULL COMMENT '成功金额 单位为元',
  `success_count` bigint(20) NOT NULL COMMENT '成功笔数',
  `failed_amount` varchar(128) NOT NULL COMMENT '失败金额',
  `fail_count` bigint(20) DEFAULT NULL COMMENT '失败笔数',
  `total_partner_benefit` bigint(20) DEFAULT NULL COMMENT '一级合伙人总收益 分',
  `total_father_partner_benefit` bigint(20) DEFAULT NULL COMMENT '二级合伙人总收益 分',
  `total_platform_benefit` bigint(20) DEFAULT NULL COMMENT '平台总收益 分',
  `not_free_success_amount` varchar(128) DEFAULT NULL COMMENT '不免费的成功金额',
  `not_free_success_count` bigint(20) DEFAULT NULL COMMENT '不免费的成功笔数',
  `final_service_price` bigint(20) DEFAULT NULL COMMENT '最终服务费 分',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_year_month_idx` (`user_id`,`year`,`month`,`partner_id`,`father_partner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户月转账统计表';

-- ----------------------------
-- Records of user_trans_month_stat
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user_trans_stat
-- ----------------------------
DROP TABLE IF EXISTS `user_trans_stat`;
CREATE TABLE `user_trans_stat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `day` date NOT NULL COMMENT '用户交易时间',
  `month` int(20) NOT NULL COMMENT '月份',
  `year` int(20) NOT NULL COMMENT '年份',
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `father_partner_id` bigint(20) DEFAULT NULL COMMENT '父合伙人id',
  `total_trans_amount` varchar(128) NOT NULL COMMENT '"批次总金额，单位为元，精确到小数点后两位，取值范围[0.01,9999999999999.99]  必选',
  `total_count` bigint(20) NOT NULL COMMENT '批次总笔数 10 必选',
  `success_amount` varchar(128) NOT NULL COMMENT '成功金额 单位为元',
  `success_count` bigint(20) NOT NULL COMMENT '成功笔数',
  `failed_amount` varchar(128) NOT NULL COMMENT '失败金额',
  `fail_count` bigint(20) DEFAULT NULL COMMENT '失败笔数',
  `total_partner_benefit` bigint(20) DEFAULT NULL COMMENT '一级合伙人总收益 分',
  `total_father_partner_benefit` bigint(20) DEFAULT NULL COMMENT '二级合伙人总收益 分',
  `total_platform_benefit` bigint(20) DEFAULT NULL COMMENT '平台总收益 分',
  `not_free_success_amount` varchar(128) DEFAULT NULL COMMENT '不免费的成功金额',
  `not_free_success_count` bigint(20) DEFAULT NULL COMMENT '不免费的成功笔数',
  `final_service_price` bigint(20) DEFAULT NULL COMMENT '最终服务费 分',
  `create_time` datetime NOT NULL COMMENT '创建时间',
  `modify_time` datetime NOT NULL COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_day_idx` (`user_id`,`day`),
  KEY `user_id_idx` (`user_id`),
  KEY `day_idx` (`day`)
) ENGINE=InnoDB AUTO_INCREMENT=1137 DEFAULT CHARSET=utf8 COMMENT='用户转账统计表';

-- ----------------------------
-- Records of user_trans_stat
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for x1
-- ----------------------------
DROP TABLE IF EXISTS `x1`;
CREATE TABLE `x1` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `start_day` date DEFAULT NULL COMMENT '开始日期',
  `end_day` date DEFAULT NULL COMMENT '截止日期',
  `recharge_amount` bigint(20) DEFAULT NULL COMMENT '正向充值金额 分',
  `reverse_recharge_amount` bigint(20) DEFAULT NULL COMMENT '反向充值金额',
  `success_service_price` bigint(20) DEFAULT NULL COMMENT '成功转账的服务费 分',
  `real_success_service_price` bigint(20) DEFAULT NULL COMMENT '实际成功转账的服务费 分 (废弃)',
  `total_partner_benefit` bigint(20) DEFAULT NULL COMMENT '合伙人总收益 分',
  `total_father_partner_benefit` bigint(20) DEFAULT NULL COMMENT '父级合伙人总收益 分',
  `total_platform_benefit` bigint(20) DEFAULT NULL COMMENT '平台总收益 分',
  `success_amount` decimal(19,2) DEFAULT NULL COMMENT '成功金额 单位为元',
  `success_count` bigint(20) DEFAULT NULL COMMENT '成功笔数',
  `safe_pay_success_service_price` bigint(20) DEFAULT NULL COMMENT '安全付成功转账的服务费 分',
  `safe_pay_total_partner_benefit` bigint(20) DEFAULT NULL COMMENT '安全付合伙人总收益 分',
  `safe_pay_total_father_partner_benefit` bigint(20) DEFAULT NULL COMMENT '安全付父级合伙人总收益 分',
  `safe_pay_total_platform_benefit` bigint(20) DEFAULT NULL COMMENT '安全付平台总收益 分',
  `safe_pay_success_amount` decimal(19,2) DEFAULT NULL COMMENT '安全付成功金额 单位为元',
  `safe_pay_success_count` bigint(20) DEFAULT NULL COMMENT '安全付成功笔数',
  `partner_withdraw_amount` bigint(20) DEFAULT NULL COMMENT '合伙人提现金额',
  `user_withdraw_amount` bigint(20) DEFAULT NULL COMMENT '商家提现金额 预留字段 暂时没有',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of x1
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for x2
-- ----------------------------
DROP TABLE IF EXISTS `x2`;
CREATE TABLE `x2` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `service_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费收费比例',
  `bank_service_ratio` decimal(19,4) DEFAULT NULL COMMENT '到卡服务费收费比例',
  `start_day` date DEFAULT NULL COMMENT '开始日期',
  `end_day` date DEFAULT NULL COMMENT '截止日期',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `total_trans_amount` varchar(128) DEFAULT NULL COMMENT '批次总金额，单位为元，精确到小数点后两位，取值范围[0.01,9999999999999.99]  必选',
  `total_count` bigint(20) DEFAULT NULL COMMENT '批次总笔数 10 必选',
  `success_amount` varchar(128) DEFAULT NULL COMMENT '成功金额 单位为元',
  `success_count` bigint(20) DEFAULT NULL COMMENT '成功笔数',
  `failed_amount` varchar(128) DEFAULT NULL COMMENT '失败金额',
  `fail_count` bigint(20) DEFAULT NULL COMMENT '失败笔数',
  `success_bank_amount` varchar(128) DEFAULT NULL COMMENT '成功到卡的金额',
  `success_bank_count` bigint(20) DEFAULT NULL COMMENT '成功到卡的笔数',
  `success_alipay_amount` varchar(128) DEFAULT NULL COMMENT '成功到支付宝的金额',
  `success_alipay_count` bigint(20) DEFAULT NULL COMMENT '成功到支付宝的笔数',
  `not_free_success_amount` varchar(128) DEFAULT NULL COMMENT '不免费的金额',
  `not_free_success_count` bigint(20) DEFAULT NULL COMMENT '不免费的笔数',
  `not_free_success_bank_amount` varchar(128) DEFAULT NULL COMMENT '不免费部分到卡的金额',
  `not_free_success_bank_count` bigint(20) DEFAULT NULL COMMENT '不免费部分到卡的笔数',
  `not_free_success_alipay_amount` varchar(128) DEFAULT NULL COMMENT '不免费部分成功到支付宝的金额',
  `not_free_success_alipay_count` bigint(20) DEFAULT NULL COMMENT '不免费部分的成功到卡的金额',
  `total_partner_benefit` bigint(20) DEFAULT NULL COMMENT '一级合伙人总收益 分',
  `total_father_partner_benefit` bigint(20) DEFAULT NULL COMMENT '二级合伙人总收益 分',
  `total_platform_benefit` bigint(20) DEFAULT NULL COMMENT '平台总收益 分',
  `final_service_price` bigint(20) DEFAULT NULL COMMENT '最终服务费 分',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_end_day_idx` (`user_id`,`end_day`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of x2
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for x3
-- ----------------------------
DROP TABLE IF EXISTS `x3`;
CREATE TABLE `x3` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `mode` varchar(128) DEFAULT NULL COMMENT '收费模式',
  `service_unit_price` bigint(20) DEFAULT NULL COMMENT '服务费单价 分',
  `service_ratio` decimal(19,4) DEFAULT NULL COMMENT '服务费收费比例',
  `start_day` date DEFAULT NULL COMMENT '开始日期',
  `end_day` date DEFAULT NULL COMMENT '截止日期',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `total_trans_amount` varchar(128) DEFAULT NULL COMMENT '批次总金额，单位为元，精确到小数点后两位，取值范围[0.01,9999999999999.99]  必选',
  `total_count` bigint(20) DEFAULT NULL COMMENT '批次总笔数 10 必选',
  `success_amount` varchar(128) DEFAULT NULL COMMENT '成功金额 单位为元',
  `success_count` bigint(20) DEFAULT NULL COMMENT '成功笔数',
  `failed_amount` varchar(128) DEFAULT NULL COMMENT '失败金额',
  `fail_count` bigint(20) DEFAULT NULL COMMENT '失败笔数',
  `total_partner_benefit` bigint(20) DEFAULT NULL COMMENT '一级合伙人总收益 分',
  `total_father_partner_benefit` bigint(20) DEFAULT NULL COMMENT '二级合伙人总收益 分',
  `total_platform_benefit` bigint(20) DEFAULT NULL COMMENT '平台总收益 分',
  `not_free_success_amount` varchar(128) DEFAULT NULL COMMENT '不免费的成功金额',
  `not_free_success_count` bigint(20) DEFAULT NULL COMMENT '不免费的成功金额',
  `final_service_price` bigint(20) DEFAULT NULL COMMENT '最终服务费 分',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_end_day_idx` (`user_id`,`end_day`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of x3
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for x5
-- ----------------------------
DROP TABLE IF EXISTS `x5`;
CREATE TABLE `x5` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '商户id',
  `partner_id` bigint(20) DEFAULT NULL COMMENT '合伙人id',
  `month` int(20) DEFAULT NULL COMMENT '月份',
  `year` int(20) DEFAULT NULL COMMENT '年份',
  `type` int(20) DEFAULT NULL COMMENT '业务类型 1.批量有密  2.安全发',
  `settled` int(20) DEFAULT NULL COMMENT '是否已结算',
  `partner_settle_amount` decimal(19,2) DEFAULT NULL COMMENT '分佣金额 元',
  `success_amount` decimal(19,2) DEFAULT NULL COMMENT '成功金额 单位为元',
  `success_count` bigint(20) DEFAULT NULL COMMENT '成功笔数',
  `create_time` datetime NOT NULL,
  `modify_time` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `partner_id_user_id_year_month_type_idx` (`partner_id`,`user_id`,`year`,`month`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of x5
-- ----------------------------

DROP TABLE IF EXISTS `self_service_account`;
CREATE TABLE `self_service_account` (
                                        `id` bigint NOT NULL AUTO_INCREMENT,
                                        `user_id` bigint DEFAULT NULL COMMENT '用户编号',
                                        `out_biz_no` varchar(128) DEFAULT NULL COMMENT '订单号',
                                        `card_id` varchar(128) DEFAULT NULL COMMENT '身份证ID',
                                        `uname` varchar(128) DEFAULT NULL COMMENT '姓名',
                                        `card_no` varchar(128) DEFAULT NULL COMMENT '卡号',
                                        `import_amount` decimal(19,2) DEFAULT NULL COMMENT '导入金额',
                                        `tocard_amount` decimal(19,2) DEFAULT NULL COMMENT '到卡金额',
                                        `tax_amount` decimal(19,2) DEFAULT NULL COMMENT '税费金额',
                                        `remark` varchar(128) DEFAULT NULL COMMENT '备注',
                                        `create_time` datetime DEFAULT NULL,
                                        `modify_time` datetime DEFAULT NULL,
                                        PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4  COMMENT='自助结算表';


BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
